Upraviť

Zdieľať cez


AssemblyExtensions.TryGetRawMetadata(Assembly, Byte*, Int32) Method

Definition

Important

This API is not CLS-compliant.

Retrieves the metadata section of the assembly, for use with MetadataReader.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetRawMetadata(System::Reflection::Assembly ^ assembly, [Runtime::InteropServices::Out] System::Byte* % blob, [Runtime::InteropServices::Out] int % length);
[System.CLSCompliant(false)]
public static bool TryGetRawMetadata (this System.Reflection.Assembly assembly, out byte* blob, out int length);
[<System.CLSCompliant(false)>]
static member TryGetRawMetadata : System.Reflection.Assembly * Byte* * int -> bool

Parameters

assembly
Assembly

The assembly from which to retrieve the metadata.

blob
Byte*

When this method returns, contains the pointer to the metadata section blob.

length
Int32

When this method returns, contains the length of the metadata section blob.

Returns

true if the metadata is retrieved successfully; false upon failure. The metadata might not be available for some assemblies, such as AssemblyBuilder and AOT images.

Attributes

Remarks

Callers should not write to the metadata blob.

The metadata blob pointer will remain valid as long as the assembly is alive.

The caller is responsible for keeping the assembly object alive while accessing the metadata blob.

Applies to