开发者

Register for COM Interop

开发者 https://www.devze.com 2023-01-22 01:43 出处:网络
When the Register for COM Interop option in the build properties is checked, I get an error: Canno开发者_如何学运维t register assembly -access

When the Register for COM Interop option in the build properties is checked, I get an error:

Canno开发者_如何学运维t register assembly -access denied

When the option is unchecked, the project builds without any error. But my requirement is to register the COM objects as I need to use the same in VB. Can anyone help me out in this?


Under Windows Vista and higher, try to run Visual Studio elevated, so it has the permissions necessary to perform a regasm on your output assembly.


An extension to Frédéric Hamidi's answer (upvote for your sir), you could either run Visual Studio as administrator, or turn off the 'register for COM interop', and open up a command prompt as the administrator.

The command to register the component is then something like this (on my machine - W7 64-bit):

c:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /tlb /codebase C:\path\to\your\DLL

Personally I use the latter as the debugging process is quite complex and sometimes it's not possible to step through the code (or some of the debugging takes place on another machine)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号