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

Article translations Article translations
Article ID: 817056 - View products that this article applies to.
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
Expand all | Collapse all

On This Page

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 "Major.Minor" format.

WORKAROUND

To work around this bug, follow these steps:
  1. Use RegAsm.exe with the
    /Regfile
    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
/Regfile
option. To correct the problem, follow these steps:
  1. Run RegAsm.exe one time without using the
    /Regfile
    option.
  2. Run RegAsm.exe by using
    /Regfile
    .
  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

  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:
    regedit
  8. Locate the following registry value:
    HKEY_CLASSES_ROOT\TypeLib\{LIBID}
    A node entry with the hexadecimal value 1.12 is created.

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

Properties

Article ID: 817056 - Last Review: April 16, 2003 - Revision: 1.3
APPLIES TO
  • Microsoft .NET Framework 1.1
Keywords: 
kbcominterop kbbug KB817056

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com