0

Operating system: Windows XP Service Pack 3 Framework: Microsoft.Net\Framework\v2.0.50727

Command Prompt started as Administrator

<framework directory>\regasm /codebase Hps.Exchange.PosGateway.Client.dll /tlb
or
<framework directory>\regasm /codebase Hps.Exchange.PosGateway.Client.dll 

operating system returns:

RegAsm : 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

I do a set from the command prompt and it shows username=Administrator

Thanks Guys

Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
garaber
  • 232
  • 3
  • 13
  • It's possible that something (virus or corporate policy, for example) has changed your registry permissions. Try resetting to the default using [Solving setup errors by using the SubInACL tool to repair file and registry permissions](http://blogs.msdn.com/b/astebner/archive/2006/09/04/739820.aspx). – Holistic Developer Jan 09 '14 at 19:40
  • 1
    Holi Moli create it as an answer. Your my new hero. Do you know how to cook as well :) – garaber Jan 09 '14 at 21:19

2 Answers2

3

This might fail if for some reason you don't have the correct permission to the registry. This could be caused by a number of things, such as corporate policy or a virus/malware. Try resetting to the default using Solving setup errors by using the SubInACL tool to repair file and registry permissions.

The basic gist from that page (in case the link breaks in the future) is to download SubInACL and then run the following commands:

subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators
subinacl /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /setowner=administrators
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators
subinacl /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators
subinacl /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators
subinacl /subdirectories %programfiles%\ /grant=administrators=f /grant=system=f /grant=users=e
subinacl /subdirectories %windir%\ /grant=administrators=f /grant=system=f /grant=users=e

However, I recommend visiting the linked page as it provides more details and caveats.

Holistic Developer
  • 2,458
  • 1
  • 18
  • 27
  • Does make you wonder if the problem can reoccur though. I didn't see anything on that page that suggests what causes this condition. – Bob77 Jan 10 '14 at 22:01
  • Yeah, it's hard to say without knowing more about the machine. If it does recur, a tool like ProcMon might be able to detect it. – Holistic Developer Jan 11 '14 at 03:30
0

I have had the same problem here, I solved it by running the x86 version of regasm, instead of the x64, so in instead of

C:\Windows\Microsoft.NET\Framework64\v2.0.50727>regasm.exe

use

C:\Windows\Microsoft.NET\Framework\v2.0.50727>regasm.exe
Dai Bok
  • 3,451
  • 2
  • 53
  • 70