Share via


Project 類別

定義

表示屬於 之一 Solution 部分的專案。

public ref class Project
[System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(),nq}")]
public class Project
[<System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(),nq}")>]
type Project = class
Public Class Project
繼承
Project
屬性

屬性

AdditionalDocumentIds

與此專案相關聯的所有其他檔識別碼。

AdditionalDocuments

與此專案相關聯的所有其他檔。

AllProjectReferences

此專案所參考之所有其他專案的清單,包括不屬於方案一部分的專案。

AnalyzerConfigDocuments

AnalyzerConfigDocument與這個專案相關聯的所有 。

AnalyzerOptions

分析器為此專案所使用的選項。

AnalyzerReferences

此專案的所有診斷分析器參考清單。

AssemblyName

這個專案代表的元件名稱。

CompilationOptions

建置此專案的編譯時所使用的選項。

CompilationOutputInfo

編譯輸出檔案路徑。

DefaultNamespace

如果未定義專案的預設命名空間 (「」,這表示全域命名空間) ,如果未知或不適用,則為 null。

DocumentIds

與此專案相關聯的所有檔識別碼。

Documents

與此專案相關聯的所有一般檔。 從來源產生器產生的檔會由 傳 GetSourceGeneratedDocumentsAsync(CancellationToken) 回。

FilePath

專案檔的路徑,如果沒有專案檔,則為 null。

HasDocuments

如果專案有任何檔,則為 True。

Id

專案的識別碼。 多個 Project 實例可能會共用相同的識別碼。 不過,在任何給定的解決方案中,只有一個專案可能會有此識別碼。

IsSubmission

如果這是提交專案,則會傳回 true。

Language

與專案相關聯的語言。

LanguageServices
已淘汰.

與這個專案語言相關聯之主環境的語言服務。

MetadataReferences

此專案參考之所有其他中繼資料來源的清單 (元件) 。

Name

專案的名稱。 這可能與元件名稱不同。

OutputFilePath

輸出檔案的路徑,如果不知道則為 null。

OutputRefFilePath

參考元件輸出檔的路徑,如果不知道,則為 null。

ParseOptions

剖析這個專案的檔時所使用的選項。

ProjectReferences

此專案參考之相同方案中所有其他專案的清單。

Services

與這個專案語言相關聯之主機環境的語言服務固定快照集。 請盡可能使用 LanguageServices 此選項。

Solution

此專案所屬的解決方案。

SupportsCompilation

true 如果支援透過 方法提供資料,則 ProjectGetCompilationAsync(CancellationToken)

false 為 ,則 GetCompilationAsync(CancellationToken) 方法會改為傳回 null

Version

專案版本。 這相當於專案檔的版本。

方法

AddAdditionalDocument(String, SourceText, IEnumerable<String>, String)

在此專案的新實例中建立新的其他檔。

AddAdditionalDocument(String, String, IEnumerable<String>, String)

在此專案的新實例中建立新的其他檔。

AddAnalyzerConfigDocument(String, SourceText, IEnumerable<String>, String)

在此專案的新實例中建立新的分析器組態檔。

AddAnalyzerReference(AnalyzerReference)

建立已更新此專案的新實例,以包含指定的分析器參考,以及已經存在的分析器參考。

AddAnalyzerReferences(IEnumerable<AnalyzerReference>)

建立已更新此專案的新實例,以包含指定的分析器參考,以及已經存在的分析器參考。

AddDocument(String, SourceText, IEnumerable<String>, String)

在此專案的新實例中建立新檔。

AddDocument(String, String, IEnumerable<String>, String)

在此專案的新實例中建立新檔。

AddDocument(String, SyntaxNode, IEnumerable<String>, String)

在此專案的新實例中建立新檔。

AddMetadataReference(MetadataReference)

建立已更新此專案的新實例,以包含指定的中繼資料參考,以及已經存在的中繼資料參考。

AddMetadataReferences(IEnumerable<MetadataReference>)

建立已更新此專案的新實例,以包含指定的中繼資料參考,以及已經存在的中繼資料參考。

AddProjectReference(ProjectReference)

建立已更新此專案的新實例,以包含指定的專案參考,以及已經存在的專案參考。

AddProjectReferences(IEnumerable<ProjectReference>)

建立已更新此專案的新實例,以包含指定的專案參考,以及已經存在的專案參考。

ContainsAdditionalDocument(DocumentId)

如果專案包含具有指定識別碼的額外檔,則為 True。

ContainsAnalyzerConfigDocument(DocumentId)

如果專案包含 AnalyzerConfigDocument 具有指定識別碼的 ,則為 True。

ContainsDocument(DocumentId)

如果專案包含具有指定識別碼的檔,則為 True。

GetAdditionalDocument(DocumentId)

取得此專案中具有指定檔識別碼的其他檔。

GetAnalyzerConfigDocument(DocumentId)

取得此專案中具有指定檔識別碼的分析器組態檔。

GetChanges(Project)

取得 物件,這個物件會列出這個專案與指定專案之間新增、變更和移除的檔。

GetCompilationAsync(CancellationToken)

Compilation以非同步方式取得這個專案的 。

GetDependentSemanticVersionAsync(CancellationToken)

此專案的語意版本,包括參考專案的語意。 每當此專案的消費性宣告和/或專案相依于變更時,這個版本就會變更。

GetDependentVersionAsync(CancellationToken)

最新版的專案、其檔和所有相依專案和檔。

GetDocument(DocumentId)

取得此專案中具有指定之檔識別碼的檔。

GetDocument(SyntaxTree)

使用指定的語法樹狀結構,取得此專案中的檔。

GetDocumentId(SyntaxTree)

使用指定的語法樹狀結構,取得此專案中的 documentId。

GetLatestDocumentVersionAsync(CancellationToken)

最近修改的檔版本。

GetSemanticVersionAsync(CancellationToken)

此專案的語意版本不包含所參考專案的語意。 只有在此專案的消費性宣告變更時,此版本才會變更。

GetSourceGeneratedDocumentAsync(DocumentId, CancellationToken)

表示屬於 之一 Solution 部分的專案。

GetSourceGeneratedDocumentsAsync(CancellationToken)

取得此專案中所有來源產生的檔。

RemoveAdditionalDocument(DocumentId)

建立已更新此專案的新實例,不再包含指定的其他檔。

RemoveAdditionalDocuments(ImmutableArray<DocumentId>)

建立已更新此專案的新實例,不再包含指定的其他檔。

RemoveAnalyzerConfigDocument(DocumentId)

建立已更新此專案的新實例,不再包含指定的分析器組態檔。

RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId>)

建立不再包含指定 AnalyzerConfigDocument 之 的新方案實例。

RemoveAnalyzerReference(AnalyzerReference)

建立已更新此專案的新實例,不再包含指定的分析器參考。

RemoveDocument(DocumentId)

建立此專案的新實例更新為不再包含指定的檔。

RemoveDocuments(ImmutableArray<DocumentId>)

建立更新為不再包含指定檔之專案的新實例。

RemoveMetadataReference(MetadataReference)

建立已更新此專案的新實例,不再包含指定的中繼資料參考。

RemoveProjectReference(ProjectReference)

建立已更新此專案的新實例,不再包含指定的專案參考。

TryGetCompilation(Compilation)

如果專案已經建立且仍然快取,則嘗試取得 Compilation 此專案的快取。 在幾乎所有情況下,您應該呼叫 GetCompilationAsync(CancellationToken) ,以傳回快取 Compilation 或建立新的快取。

WithAnalyzerReferences(IEnumerable<AnalyzerReference>)

建立更新此專案的新實例,以將現有的分析器參考取代為指定的實例。

WithAssemblyName(String)

建立此專案的新實例更新為具有新的元件名稱。

WithCompilationOptions(CompilationOptions)

建立此專案的新實例更新為具有指定的編譯選項。

WithDefaultNamespace(String)

建立此專案的新實例更新為具有新的預設命名空間。

WithMetadataReferences(IEnumerable<MetadataReference>)

建立已更新此專案的新實例,以將現有的中繼資料參考取代為指定的中繼資料參考。

WithParseOptions(ParseOptions)

建立此專案的新實例更新為具有指定的剖析選項。

WithProjectReferences(IEnumerable<ProjectReference>)

建立已更新此專案的新實例,以以指定的專案取代現有的專案參考。

適用於