What is difference between RegAsm.exe and regsvr32? How to generate a tlb file using regsvr32?

regsvr32 will load the library and try to call the DllRegisterServer() from that library. It doesn’t care what DllRegisterServer() actually does – it just calls that function and checks the returned value. You use it to register COM servers in unmanaged DLLs. It can’t generate a .tlb file. regasm will register a COM-exposed .NET assembly … Read more

Use Visual Studio Setup Project to automatically register and GAC a COM Interop DLL

Gacutil.exe won’t be available on the target machine. Not a problem, MSI can get the job done. Right-click “File System on Target Machine”, Add, GAC. Right-click that added folder, Add, Project Output. That ensures the assembly is gac-ed. It can also register the assembly like Regasm.exe does. Set the Register property of the project output … Read more

Registering a COM without Admin rights

For what it’s worth, I’ve written a set of C# utilities that register/unregister a .NET type (should be marked as ComVisible of course) in user’s registry without requiring regasm, nor UAC prompts, you can use it like this: // register into current user registry, needs no specific rights ComUtilities.RegisterComObject(ComUtilities.Target.User, typeof(MyClass)); // unregister from user registry, … Read more