MetadataReference.CreateFromAssembly 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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。
assembly
是動態的、沒有位置,或平臺不支援從位置讀取。
備註
效能注意事項:
建議您在建立相同元件的多個參考時使用 CreateFromFile(String) API。 重複使用 AssemblyMetadata 物件可讓您跨這些參考共用資料。