Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"Failed to open registry key -- Unable to format error message 00000005" Error from SN.EXE


Symptoms

When running the Strong Name Utility tool with the .NET Framework 4 from a non-administrative command prompt with the -Vr, command line option to register an assembly for verification skipping:

sn -Vr ClassLibrary1.dll

 you may see the error:

Failed to open registry key -- Unable to format error message 00000005

This error can also be displayed when using the -Vu and -Vx options to unregister assembles for verification skipping.

↑ Back to the top


Cause

Verification skipping will create a registry key which requires permissions elevation of the command prompt. The correct error message when running sn -Vr from a non-elevated command prompt is:

Failed to open registry key -- access is denied

The incorrect error message in the Symptoms section is caused by a bug in the Strong Name Utility which comes with the .NET Framework 4.

↑ Back to the top


Resolution

You should register your assembly for verification skipping by running the Strong Name Utility from an elevated or administrator command prompt:

From the Start Menu, select All Programs. Open the Microsoft Visual Studio 2010 folder and then the Visual Studio Tools folder. Right-click the Visual Studio Command Prompt (2010) and click the Run as administrator context menu.

Alternatively, you can right-click any Command Prompt icon (All Programs/Accessories) and choose Run as administrator. Navigate to the Visual Studio 2010 SDK tools directory (e.g. C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bin) and run SN.EXE.

↑ Back to the top


Keywords: vkball, kb

↑ Back to the top

Article Info
Article ID : 2022742
Revision : 1
Created on : 1/8/2017
Published on : 4/28/2010
Exists online : False
Views : 139