Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Marshal.GetTypeLibGuidForAssembly Method

Retrieves the library identifier (LIBID) that is assigned to a type library when it was exported from the specified assembly.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)
public static Guid GetTypeLibGuidForAssembly(
	Assembly asm
)

Parameters

asm
Type: System.Reflection.Assembly

The assembly from which the type library was exported.

Return Value

Type: System.Guid
The LIBID that is assigned to a type library when it is exported from the specified assembly.
ExceptionCondition
ArgumentNullException

asm is null.

When assemblies are exported to type libraries, the type library is assigned a LIBID. You can set the LIBID explicitly by applying the System.Runtime.InteropServices.GuidAttribute at the assembly level, or it can be generated automatically. The Tlbimp.exe (Type Library Importer) tool calculates a LIBID value based on the identity of the assembly. GetTypeLibGuid returns the LIBID that is associated with the GuidAttribute, if the attribute is applied. Otherwise, GetTypeLibGuidForAssembly returns the calculated value. Alternatively, you can use the GetTypeLibGuid method to extract the actual LIBID from an existing type library.

See the Exported Assembly Conversion topic for more information about library identifiers.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.