none
Error when regsvr32 a DLL created under VS 2013: "...entry-point DllRegisterServer was not found..."

    Question

  • I have created a DLL with VS 2013/vb. The program runs since I can use it on my development system. But when I try to register the DLL, I get the following error:

    "The module 'myprog.dll' was loaded but the entry-point DllREgisterServer was not found. Make sure that 'myprog.dll' is a valid DLL or OCX file and then try again."

    I'm running the cmd prompt as administrator. 
    "Register for COM interop" is checked.

    Any insight why I'm not able to register the DLL is appreciated.

    Thanks,

    jan


    Wednesday, April 6, 2016 6:37 PM

Answers

  • I used regasm on the other computer to register the DLL, restarted the Access application. And it works. So regsvr32 does not work on DLL's created with vb. 

    So, when I publish the application to other sites, what is the easiest way to register the DLL? it looks like the regasm file may not be in the same location, depending on the version of .net installed. Is there an easy way to automatically register the dll with regasm via a script?

    Thanks,

    Jan

    Jan, just for clarity, regsvr32.exe is used to register COM DLL's. These are typically DLL's that are written in native code such as C++ (although there are exceptions to this).

    Class libraries that are generated used VB.NET or C# are .NET assemblies, and these cannot be registered using regsvr32.exe since they are not COM DLL's. What regasm.exe does essentially is to add the COM veneer (the COM interop) to the assembly, so that it becomes callable by any COM client such as VBA.

    Your question touches on deployment, in particular how to deploy a .net assembly smoothly. ClickOnce technology is one strategy to accomplish this, and you should research this to see if it is suitable for your project. Otherwise, use your Google/Bing skills to search for "how to publish .net assembly" and follow the links.

    • Marked as answer by bearmtn Wednesday, April 6, 2016 10:34 PM
    Wednesday, April 6, 2016 8:40 PM

All replies

  • dumpbin /exports myprog.dll

    Wednesday, April 6, 2016 6:39 PM
  • Is this a managed dll?  Should you maybe be using regasm.exe?
    Wednesday, April 6, 2016 6:44 PM
  • I created it using "Class Library" under .net 4.5. Should I have been using "Class Library (Portable)" instead?

    I tried regasm, but got the following msg: "Failed to load 'C:\...\myprog.dll' because oit is not a valid .NET assembly"


    • Edited by bearmtn Wednesday, April 6, 2016 6:57 PM
    Wednesday, April 6, 2016 6:52 PM
  • dumpbin /exports myprog.dll


    4000 .rsrc
    2000 .sdata
    2000 .text

    Thanks,

    jan

    Wednesday, April 6, 2016 6:57 PM
  • More information: 

    I'm using the DLL in MS Access VBA. When I build the DLL, a reference to it is shown in the References window in VBA (miraculously). I make sure the DLL is selected in the references. The database that calls the dll function works as it is supposed to. But when I try to create the same reference on a different computer using the browse, I get "Can't add a reference to the specified file". 

    Do I need to use regasm on the other computer to make it appear in the VBA's references? Does it matter if the other computer is using a different version of .net?

    Thanks,

    jan

    Wednesday, April 6, 2016 7:18 PM
  • I used regasm on the other computer to register the DLL, restarted the Access application. And it works. So regsvr32 does not work on DLL's created with vb. 

    So, when I publish the application to other sites, what is the easiest way to register the DLL? it looks like the regasm file may not be in the same location, depending on the version of .net installed. Is there an easy way to automatically register the dll with regasm via a script?

    Thanks,

    Jan

    Wednesday, April 6, 2016 7:32 PM
  • I used regasm on the other computer to register the DLL, restarted the Access application. And it works. So regsvr32 does not work on DLL's created with vb. 

    So, when I publish the application to other sites, what is the easiest way to register the DLL? it looks like the regasm file may not be in the same location, depending on the version of .net installed. Is there an easy way to automatically register the dll with regasm via a script?

    Thanks,

    Jan

    Jan, just for clarity, regsvr32.exe is used to register COM DLL's. These are typically DLL's that are written in native code such as C++ (although there are exceptions to this).

    Class libraries that are generated used VB.NET or C# are .NET assemblies, and these cannot be registered using regsvr32.exe since they are not COM DLL's. What regasm.exe does essentially is to add the COM veneer (the COM interop) to the assembly, so that it becomes callable by any COM client such as VBA.

    Your question touches on deployment, in particular how to deploy a .net assembly smoothly. ClickOnce technology is one strategy to accomplish this, and you should research this to see if it is suitable for your project. Otherwise, use your Google/Bing skills to search for "how to publish .net assembly" and follow the links.

    • Marked as answer by bearmtn Wednesday, April 6, 2016 10:34 PM
    Wednesday, April 6, 2016 8:40 PM
  • Thanks for a nice explanation. Yes, deployment is my next task and I will research that using my duckduckgo :-)

    Wednesday, April 6, 2016 10:35 PM