MetadataReference.CreateFromAssembly 方法

定义

重载

CreateFromAssembly(Assembly)
已过时.

创建对已加载程序集的引用。

CreateFromAssembly(Assembly, MetadataReferenceProperties, DocumentationProvider)
已过时.

创建对已加载程序集的引用。

CreateFromAssembly(Assembly)

Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs

注意

Use CreateFromFile(assembly.Location) instead

创建对已加载程序集的引用。

public:
 static Microsoft::CodeAnalysis::MetadataReference ^ CreateFromAssembly(System::Reflection::Assembly ^ assembly);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("Use CreateFromFile(assembly.Location) instead", true)]
public static Microsoft.CodeAnalysis.MetadataReference CreateFromAssembly (System.Reflection.Assembly assembly);
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[<System.Obsolete("Use CreateFromFile(assembly.Location) instead", true)>]
static member CreateFromAssembly : System.Reflection.Assembly -> Microsoft.CodeAnalysis.MetadataReference
Public Shared Function CreateFromAssembly (assembly As Assembly) As MetadataReference

参数

assembly
Assembly

模块文件的路径。

返回

属性

例外

assembly 为 null。

assembly 是动态的,没有位置,或者平台不支持从位置读取。

注解

性能注意事项:

建议在创建对同一程序集的多个引用时使用 CreateFromFile(String) API。 AssemblyMetadata重用对象允许跨这些引用共享数据。

适用于

CreateFromAssembly(Assembly, MetadataReferenceProperties, DocumentationProvider)

Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs
Source:
MetadataReference.cs

注意

Use CreateFromFile(assembly.Location) instead

创建对已加载程序集的引用。

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("Use CreateFromFile(assembly.Location) instead", true)]
public static Microsoft.CodeAnalysis.MetadataReference CreateFromAssembly (System.Reflection.Assembly assembly, Microsoft.CodeAnalysis.MetadataReferenceProperties properties, Microsoft.CodeAnalysis.DocumentationProvider documentation = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("Use CreateFromFile(assembly.Location) instead", true)]
public static Microsoft.CodeAnalysis.MetadataReference CreateFromAssembly (System.Reflection.Assembly assembly, Microsoft.CodeAnalysis.MetadataReferenceProperties properties, Microsoft.CodeAnalysis.DocumentationProvider? documentation = default);
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[<System.Obsolete("Use CreateFromFile(assembly.Location) instead", true)>]
static member CreateFromAssembly : System.Reflection.Assembly * Microsoft.CodeAnalysis.MetadataReferenceProperties * Microsoft.CodeAnalysis.DocumentationProvider -> Microsoft.CodeAnalysis.MetadataReference
Public Shared Function CreateFromAssembly (assembly As Assembly, properties As MetadataReferenceProperties, Optional documentation As DocumentationProvider = Nothing) As MetadataReference

参数

assembly
Assembly

模块文件的路径。

properties
MetadataReferenceProperties

引用属性 (外部别名,键入嵌入) 。

documentation
DocumentationProvider

提供在引用中找到的符号的 XML 文档。

返回

属性

例外

assembly 为 null。

properties.Kind 不是 Assembly

assembly 是动态的,没有位置,或者平台不支持从位置读取。

注解

性能注意事项:

建议在创建对同一程序集的多个引用时使用 CreateFromFile(String) API。 AssemblyMetadata重用对象允许跨这些引用共享数据。

适用于