0
votes

I have a .DLL file for x64 architecture without adequate documentation. I tried the following as a .NET Core Console App in Visual Studio 2017 adding the DLL as a reference:

Imports System

Module Program
    Sub Main(args As String())
        Dim newObject As NewNamespace.NewInterface

        'Create New Instance
        newObject = NewNamespace.Factory.Instance.Create()

        'Do something

        'Clean up
        NewNamespace.Factory.Instance.Destroy()

    End Sub
End Module

When I tried to run the code in Debug for X64 CPU I get the following error:

System.TypeInitializationException

EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods.

EDIT: Removed a lot of unnecessary information

1
Try a .NET Framework project instead of .NET Core. - jmcilhinney
I still get the same error - System.EntryPointNotFoundException: 'Unable to find an entry point named 'GXW3OpenIFManagedFactory' in DLL 'GXW3OpenIF64.dll'.' - Flash_Steel
You are successfully adding a reference to that DLL in your Console Application project, right? If so then you definitely should not be using DllImport anywhere. Get rid of all that and open the Object Explorer window and see what types and members that indicates are accessible. - jmcilhinney
If you're looking inside the DLL and seeing only an interface then it kinda seems like you should have another DLL that contains a class that implements that interface. Is the library publicly available? I've searched for some of the terms from your question and this thread was the only result. - jmcilhinney
@jmcilhinney - Adding the DLL to the references without DLLImport I get the following error: EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods. Is there a way I can solve this without using DLLImport? - Flash_Steel

1 Answers

0
votes

Using the same code and references in a .Net Framework Console project in VS2017 build and ran the code without error.