Skip to content

Trouble using external assemblies #20

@nwamsley1

Description

@nwamsley1

I have been having trouble using external assemblies. Following the readme I have tried the following:

using DotNET
reader = T"System.Reflection.Assembly".LoadFrom(raw"/Users/n.t.wamsley/Projects/Julia_Testing/ThermoFisher.CommonCore.RawFileReader.dll")

Which returns

System.Reflection.RuntimeAssembly("ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953")

How can I use methods and types from this library? For example in the RawFileReader library,
there is an attribute 'RawFileReaderAdapter' with a method 'FileFactory'. I would like to do something like

rawFile = RawFileReaderAdapter.FileFactory(filename)

rawFile then has methods I could call to return data from the file.

The problem is that if I enter the following

rawfilereaderadapter = reader.GetType("ThermoFisher.CommonCore.RawFileReader.RawFileReaderAdapter", true, true)
filefactory = rawfilereaderadapter.GetMethod("FileFactory")
filefactory.ReturnType
filefactory.ReturnTypeCustomAttributes

I get

ThermoFisher.CommonCore.RawFileReader.RawFileReaderAdapter
System.Reflection.RuntimeMethodInfo("ThermoFisher.CommonCore.Data.Interfaces.IRawDataExtended FileFactory(System.String)")
ThermoFisher.CommonCore.Data.Interfaces.IRawDataExtended
System.Reflection.RuntimeParameterInfo("ThermoFisher.CommonCore.Data.Interfaces.IRawDataExtended")

respectively. Now I need to invoke the FileFactory method.

julia> filepath = convert(CLRObject, "/Users/n.t.wamsley/Projects/SAGE_TESTING/MA4358_FFPE_HPVpos_01_071522.raw")
julia> rawfile = filefactory.Invoke("", [filepath])
ThermoFisher.CommonCore.RawFileReader.RawFileAccess("ThermoFisher.CommonCore.RawFileReader.RawFileAccess")
julia> rawfile.IsOpen
false

rawfile.IsOpen should be returning true. I have verified that the file path is correct. So I suspect I am passing methods incorrectly. I wasn't sure if you had any ideas about what I could be doing wrong?

Here is a snippet from the .xml file describing the types and methods defined in the dll

 <member name="T:ThermoFisher.CommonCore.RawFileReader.RawFileReaderAdapter">
            <summary>
            This static class contains factories to open raw files
            </summary>
        </member>
        <member name="M:ThermoFisher.CommonCore.RawFileReader.RawFileReaderAdapter.FileFactory(System.String)">
            <summary>
            Create an IRawDataExtended interface to read data from a raw file
            </summary>
            <param name="fileName">File to open</param>
            <returns>Interface to read data from file</returns>
        </member>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions