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:
Use RegAsm.exe with the
command line option.
This generates the .reg file that contains the registry files that you need.
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:
Run RegAsm.exe one time without using the
Run RegAsm.exe by using
Edit the .reg file.
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
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.
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: