Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to build a .NET DLL with COM visible types without VS requiring elevation?

An assembly in a project has a type marked with ComVisible(true).

When building (non-elevated), VS tries to register that DLL and fails:

Cannot register assembly "\path\to\foo.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\CLSID{FFC174A1-CC90-4E25-A3F6-C30B03368250}' is denied.

We don't really want the DLL registering on the build machines. We only want to register it when we install it for the end user.

So is it possible to build without registering the DLL?

like image 466
Rik Hemsley Avatar asked Mar 24 '11 11:03

Rik Hemsley


1 Answers

So is it possible to build without registering the DLL?

Yes. In the project settings (right click, "Properties") under "Build", there is a "register for COM interop" checkbox.

like image 115
Wim Coenen Avatar answered Sep 30 '22 04:09

Wim Coenen