Register dll from within console app or commandline

Xortock

New member
Joined
Mar 28, 2022
Messages
1
Programming Experience
Beginner
Does anyone know how I can register a dll from within a c# console app or from the commandline with regsvr
 
The cheap way would be to just call regsvr32.exe there same way you would call it on the command line. Just use Process.Start() variant that takes two parameters.

The hard way is to use P/Invoke to call the DllRegisterServer() entry point of the DLL you are trying to register. That is essentially what Regsvr32 does anyway.

Out of curiosity, why would you want to do this registration in your console app? Registration should be done at setup time when your app is installed.
 
Back
Top Bottom