Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to register the C# dll as a COM Component, The module was loaded but the entry-point DLLRegisterServer was not found [duplicate]

I have created a class and made it com visible:

[ComVisible(true)]
    [Guid("FD909333-3CD0-477F-8A7E-B8045B0B84EC")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("TestComApp.TestApp.TestClass")]
    public class TestClass:ITestCom
    {
        public int Add(int a, int b) { return a + b; }
    }

Also the interface is set to be COM visible:

[ComVisible(true)]
    [Guid("26567B41-15DB-4EE2-A277-357EAE96BF6A")]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    interface ITestCom
    {
         int Add(int a, int b);
    }

But when I am trying to register the DLL

regsvr32 /i TestComApp.dll

I am getting the following error "The module was loaded but the entry-point DLLRegisterServer was not found"

enter image description here

like image 714
Simsons Avatar asked Oct 20 '25 08:10

Simsons


1 Answers

To register a .NET DLL, you need to use Regasm.exe instead of regsvr32.exe. Regasm.exe is located in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (or similar depending on .NET version).

Also make sure to specify the /codebase option, or make the assembly strongly-named, otherwise COM won't be able to find the DLL.

like image 92
user1610015 Avatar answered Oct 22 '25 23:10

user1610015



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!