Unable to run RegAsm: Error related to access to the Registry

ashtee picture ashtee · Jul 7, 2012 · Viewed 7k times · Source

I have a C++ project that calls RegAsm in the pre-build event for a couple of assemblies. The pre-build event fails with following error:

Error 1 error RA0000 : An error occurred while writing the registration
information to the registry. You must have administrative credentials to perform 
 this task. Contact your system administrator for assistance.   RegAsm  

When I checked the BuildLog.htm it has following command in the pre-build event:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm 
    ../../../CommonLib/release/Services.dll 
    /tlb:c:\TFS\Console\Solution\Bridge\Services.tlb

So I copied the command and ran it in the Visual Studio 2010 command prompt as Administrator but got the same error.

I used to be able to build this project fine until recently. Not sure what is causing this problem. Any help is appreciated.

I am part of Administrators group on this computer and have turned off the UAC.

Answer

abhinav picture abhinav · Jan 10, 2013

open cmd by right click then "run as administrator"