简体   繁体   中英

Why do I have to register COM DLLs using regasm?

I have created a COM DLL with VB.NET. It has COMVisible = true, and using its TLB file, I can use this DLL in VB6.

On test machines, I can only use the COM DLL in a VB6 application after it has been registered using regasm.exe.

Does anybody know why I have to register it using regasm, or if there is any way that I don't have to register it using regasm?

.NET doesn't make COM dlls. It simulates COM. When you register a .NET COM DLL it registers the core .NET DLL (MSCORE.DLL) that handles and translates COM calls and passes on to the .NET DLL.

If regasm only being able to do per machine installs is the problem with the above, then export as a reg file from Regasm. Search and replace HKCR with HKCU\\Software\\Classes then regedit /s <path to reg file> . Non admins can install by merging the reg file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM