When you try to register a .NET assembly for COM Interop,
you receive the following error message:
registration failed. Access to the registry key denied
: The error message may contain the key name in some
This error can occur under the following circumstances:
- You build an assembly that registers itself for COM
- You use the Assembly Registration utility (Regasm.exe) to
register the assembly for COM Interop.
The error may occur even if the person who performs the
operation is an Administrator on the system.
This problem occurs because the current user does not have
the correct permissions for the following key in the Windows registry:
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
How to back up and restore the registry in Windows
To resolve this problem, follow these steps:
- Log on to the computer with an account that is a member of
the Administrators group on the local computer.
- Click Start, click Run, and then type regedt32 to start Registry
NOTE: On a computer that is running Windows NT 4.0 or Windows 2000,
you must run Regedt32.exe to review and to set permissions in the Windows
registry. On a computer that is running Windows XP, you can run either
Regedt32.exe or Regedit.exe.
- Locate and then click the following subkey:
- If your computer is running Windows NT 4.0 or Windows 2000,
click Permissions on the Security menu.
If your computer is running Windows XP,
right-click the key, and then click Permissions.
- Click Advanced.
- Click to select the Inherit Permission from Parent
Object check box, and then click Apply.
- Verify that all of the users or the groups who will be
registering or using .NET assemblies through COM Interop have the following
- Query Value
- Enumerate Subkeys
- Read Control
To verify the permissions, double-click the user or
the group. If any of the users or the groups do not have any of these
permissions, click to select the Allow check box for the missing permissions.
additional users or groups to the list, click Add in the Advanced Settings dialog box. Typically, as long as the Users, the Power Users, and
the Administrators in the group are present with the correct permissions,
everything works correctly.
- Close Registry Editor.
- Register the .NET assembly for COM Interop by using
Microsoft Visual Studio .NET or the Regasm.exe utility.
This bug was
corrected in .NET Framework 1.1.
Article ID: 327507 - Last Review: June 5, 2003 - Revision: 4.3
- Microsoft .NET Framework 1.0, when used with:
- the operating system: Microsoft Windows XP
- the operating system: Microsoft Windows 2000
- Microsoft Windows NT 4.0