Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tfs build error Cannot register assembly "MyAssembly.dll" - access denied

I have a C# web service project. I created a client that creates and manages the connection to the service. We have an older PC product that is written in C++ and they need to have an interface to make calls to the service. I created some calls on the client for them and made new objects that are COM visible to pass the data around. I then check the box in the project settings that says “Register for COM interop”. This all seems to build and work locally (I run visual studio as an admin). But when I check in on my TFS server the build fails stating: Cannot register assembly "MyClient.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\MyClient.MyClass' is denied. Is there a way to elevate my token on the build machine or some other way to resolve this?

like image 998
JonesCola Avatar asked Dec 01 '22 01:12

JonesCola


1 Answers

You need to pass below value to MSBuild using the MSBuild Arguments option in process parameter of your build definition.

/p:RegisterForComInterop=false

like image 85
Jehan33 Avatar answered Dec 05 '22 11:12

Jehan33