Unable to register DLL using Regsv32 - error “Dll was loaded but the entry-point DllRegisterServer was not found”

元气小坏坏 提交于 2019-12-14 03:58:54

问题


I have written my own class library using C# 3.5. For using this dll in classic ASP application, I am trying to register this dll in Registry using regsvr32 command. But I am getting typical error like "The module "TestDll.dll" was loaded but the entry-point DllRegisterServer was not found.Make sure that "TestDll.dll" is a valid DLL or OCX file and then try again**."

I found other option to include switch /tlb in regsvr32 command, by its this going ahead. But I am sure if really my dll is getting registered or not ?

Could you please let me know what am I missing here ? Its very urgent.

(Note :- I have OS windows 7 on my machine. Does it make difference ?) Quickest response will be really appreciated.

Regards Sarang


回答1:


You are attempting to register a dll that is not a COM library. Pre .NET com dlls need to export a set of functions and interface implementations that support things like self registration (in your case) and class factory things. These standardized exports were essentially the hooks by which the com implementation in windows was/is able to interact with a DLL via com conventions.

For .NET, these exports, and the tools that need them like regsvr32, do not apply directly to the assemblies we create, even if they are set up for com interop.

Registration and type initialization is handled quite differently for .net interop. Registration for instance is handled by a tool called regasm.

Do some research on com callable wrappers .net/com interop. http://msdn.microsoft.com/en-us/library/bd9cdfyx.aspx



来源:https://stackoverflow.com/questions/18115538/unable-to-register-dll-using-regsv32-error-dll-was-loaded-but-the-entry-point

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!