You are currently offline, waiting for your internet to reconnect

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

This article has been archived. It is offered "as is" and will no longer be updated.
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
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 "Major.Minor" format.
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.
  2. 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
  2. Run RegAsm.exe by using
  3. Edit the .reg file.
  4. Run RegAsm.exe.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
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

  1. 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 "Major.Minor" version is in decimal number format.
  2. Open a Microsoft Visual Studio .NET command prompt.
  3. Locate the directory that contains the MyComponent.tlb file.
  4. Run the following command to generate a strong name key pair file:
    sn -k mykey.snk
  5. Run the following command to create the PIA as MyComponentLib.Dll:
    TlbImp MyComponent.Dll /keyfile:mykey.snk /primary 
  6. Run the following command to register the PIA:
    regasm MyComponentLib.Dll
  7. Run the following command to open Registry Editor:
  8. Locate the following registry value:
    A node entry with the hexadecimal value 1.12 is created.

    Note Create the registry value as hexadecimal value "1.C".

Article ID: 817056 - Last Review: 12/08/2015 02:20:35 - Revision: 1.3

Microsoft .NET Framework 1.1

  • kbnosurvey kbarchive kbcominterop kbbug KB817056