Microsoft KB Archive/327507

= FIX: &quot;Access to the Registry Key Denied&quot; Error Message When You Register .NET Assembly for COM Interop =

Article ID: 327507

Article Last Modified on 6/5/2003

-

APPLIES TO

 Microsoft .NET Framework 1.0, when used with:  Microsoft Windows XP Professional

 Microsoft Windows 2000 Standard Edition

 Microsoft Windows NT 4.0 

-

<div class="notice_section">

This article was previously published under Q327507

<div class="notice_section">

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

<div class="symptoms_section">

SYMPTOMS
When you try to register a .NET assembly for COM Interop, you receive the following error message:

COM Interop registration failed. Access to the registry key denied

NOTE: The error message may contain the key name in some instances.

This error can occur under the following circumstances:
 * You build an assembly that registers itself for COM Interop. -or-


 * 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.

<div class="cause_section">

CAUSE
This problem occurs because the current user does not have the correct permissions for the following key in the Windows registry:

HKEY_CLASSES_ROOT\Component Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}

<div class="resolution_section">

RESOLUTION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To resolve this problem, follow these steps: <ol> Log on to the computer with an account that is a member of the Administrators group on the local computer.</li> Click Start, click Run, and then type regedt32 to start Registry Editor.

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.</li> Locate and then click the following subkey:

HKEY_CLASSES_ROOT\Component Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}

</li> 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.</li> Click Advanced.</li> Click to select the Inherit Permission from Parent Object check box, and then click Apply.</li> Verify that all of the users or the groups who will be registering or using .NET assemblies through COM Interop have the following advanced permissions:

 Query Value</li> Enumerate Subkeys</li> Notify</li> Read Control</li></ul>

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.

To add 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.</li> Close Registry Editor.</li> Register the .NET assembly for COM Interop by using Microsoft Visual Studio .NET or the Regasm.exe utility.</li></ol>

<div class="status_section">

This bug was corrected in .NET Framework 1.1.

Additional query words: Access denied Regasm

Keywords: kbfix KB327507

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.