Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Interoperability
 Generating Primary Interop Assembli...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Developer's Guide
Generating Primary Interop Assemblies

There are two ways to generate a primary interop assembly:

  • Using the Type Library Importer (Tlbimp.exe) provided by the Windows Software Development Kit (SDK).

    Producing a primary interop assembly by using Tlbimp.exe to import a type library is straightforward. Tlbimp.exe provides the following safeguards:

    • Checks for other registered primary interop assemblies before creating new interop assemblies for any nested type library references.

    • Fails to emit the primary interop assembly if you do not specify either the container or file name to give the primary interop assembly a strong name.

    • Fails to emit a primary interop assembly if you omit references to dependent assemblies.

    • Fails to emit a primary interop assembly if you add references to dependent assemblies that are not primary interop assemblies.

  • Creating primary interop assemblies manually in source code by using a language that is compliant with the Common Language Specification (CLS), such as C#. This approach is useful when a type library is unavailable.

You must have a cryptographic key pair to sign the assembly with a strong name. For details, see Creating A Key Pair.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker