Microsoft KB Archive/817056

= BUG: The Microsoft .NET Framework Assembly Registration Utility Registers the Primary Interop Assembly with the Wrong Version Number Under the Type Library Key =

Article ID: 817056

Article Last Modified on 4/16/2003

-

APPLIES TO


 * Microsoft .NET Framework 1.1

-



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



SYMPTOMS
While creating a Primary Interop Assembly (PIA), the Microsoft .NET Framework Assembly Registration utility (RegAsm.exe) registers the version number of the Type Library in decimal value with &quot;Major.Minor&quot; format.



WORKAROUND
To work around this bug, follow these steps:
 * 1) Use RegAsm.exe with the   command line option.

This generates the .reg file that contains the registry files that you need.
 * 1) Manually edit the decimal value of the version number. Change the value to the corresponding hexadecimal value, and then run the .reg file.

RegAsm.exe depends on Oleaut32.dll to register the Type Library and the registry information that it does not write to the .reg file when you run RegAsm.exe by using the  option. To correct the problem, follow these steps:
 * 1) Run RegAsm.exe one time without using the   option.
 * 2) Run RegAsm.exe by using.
 * 3) Edit the .reg file.
 * 4) Run RegAsm.exe.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
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.

Steps to Reproduce the Behavior
 Create and register a COM Component (MyComponent.dll) with a version number that is more than 9 in decimal value. For example, use the version string as 1.12.

Note The &quot;Major.Minor&quot; version is in decimal number format. Open a Microsoft Visual Studio .NET command prompt. Locate the directory that contains the MyComponent.tlb file.  Run the following command to generate a strong name key pair file: sn -k mykey.snk   Run the following command to create the PIA as MyComponentLib.Dll: TlbImp MyComponent.Dll /keyfile:mykey.snk /primary   Run the following command to register the PIA: regasm MyComponentLib.Dll </li>  Run the following command to open Registry Editor: regedit </li> Locate the following registry value:

 

A node entry with the hexadecimal value 1.12 is created.

Note Create the registry value as hexadecimal value &quot;1.C&quot;.</li></ol>

Keywords: kbbug kbcominterop KB817056

-

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

© Microsoft Corporation. All rights reserved.