Share via


Solution 類別

定義

表示一組專案及其原始程式碼檔。

public ref class Solution
public class Solution
type Solution = class
Public Class Solution
繼承
Solution

屬性

AnalyzerReferences

與解決方案相關聯的分析器參考。

FilePath

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

Id

解決方案的識別碼。 多個解決方案實例可能會共用相同的識別碼。

Options

傳回應套用至此解決方案的選項。 這相當於 Options 建立實例的時間 Solution

ProjectIds

方案包含之所有專案的所有識別碼清單。

Projects

方案包含的所有專案清單。

Services

主機環境所提供的每個解決方案服務。 請盡可能使用此專案, Services 而不是 。

Version

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

Workspace

此解決方案相關聯的工作區。

方法

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

建立已更新對應專案的新方案實例,以包含其名稱和文字所定義的新其他檔實例。

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

建立已更新對應專案的新方案實例,以包含其名稱和文字所定義的新其他檔實例。

AddAdditionalDocument(DocumentInfo)

表示一組專案及其原始程式碼檔。

AddAdditionalDocuments(ImmutableArray<DocumentInfo>)

表示一組專案及其原始程式碼檔。

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

建立已更新對應專案的新方案實例,以包含其名稱和文字所定義的新分析器組態檔實例。

AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo>)

建立新的方案實例,其中包含新的編譯器組態檔,例如 .editorconfig 檔案。

AddAnalyzerReference(AnalyzerReference)

建立更新的新解決方案實例,以包含指定的分析器參考。

AddAnalyzerReference(ProjectId, AnalyzerReference)

建立新的方案實例,其中包含指定的更新專案,以包含指定的分析器參考。

AddAnalyzerReferences(IEnumerable<AnalyzerReference>)

建立更新的新解決方案實例,以包含指定的分析器參考。

AddAnalyzerReferences(ProjectId, IEnumerable<AnalyzerReference>)

使用已更新的專案建立新的方案實例,以包含指定的分析器參考。

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

建立已更新對應專案的新方案實例,以包含由其名稱和文字所定義的新檔實例。

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

建立已更新對應專案的新方案實例,以包含由其名稱和文字所定義的新檔實例。

AddDocument(DocumentId, String, SyntaxNode, IEnumerable<String>, String, Boolean, PreservationMode)

建立已更新對應專案的新方案實例,以包含其名稱和根 SyntaxNode 所定義的新檔實例。

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

建立已更新專案的新方案實例,以包含具有指定引數的新檔。

AddDocument(DocumentInfo)

建立已更新對應專案的新方案實例,以包含檔資訊所定義的新檔實例。

AddDocuments(ImmutableArray<DocumentInfo>)

使用對應的 Project 更新建立新的 Solution 實例,以包含 所 documentInfos 指定的檔。

AddMetadataReference(ProjectId, MetadataReference)

建立新的方案實例,並更新指定的專案以包含指定的中繼資料參考。

AddMetadataReferences(ProjectId, IEnumerable<MetadataReference>)

使用指定的專案來建立新的方案實例,以包含指定的中繼資料參考。

AddProject(ProjectId, String, String, String)

建立新的方案實例,其中包含具有指定語言和名稱的專案。

AddProject(ProjectInfo)

建立包含具有指定專案資訊之專案的新方案實例。

AddProject(String, String, String)

建立新的方案實例,其中包含具有指定語言和名稱的專案。 傳回新專案。

AddProjectReference(ProjectId, ProjectReference)

使用已更新的專案建立新的方案實例,以包含指定的專案參考。

AddProjectReferences(ProjectId, IEnumerable<ProjectReference>)

建立新的方案實例,其中指定的專案已更新,以包含指定的專案參考。

ContainsAdditionalDocument(DocumentId)

如果方案在其其中一個專案中包含其他檔,則為 True

ContainsAnalyzerConfigDocument(DocumentId)

如果方案在其其中一個專案中包含分析器組態檔,則為 True

ContainsDocument(DocumentId)

如果方案在其其中一個專案中包含檔,則為 True

ContainsProject(ProjectId)

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

GetAdditionalDocument(DocumentId)

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

GetAnalyzerConfigDocument(DocumentId)

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

GetChanges(Solution)

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

GetDocument(DocumentId)

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

GetDocument(SyntaxTree)

取得此方案中具有指定語法樹狀結構的檔。

GetDocumentId(SyntaxTree)

取得此方案中具有指定語法樹狀結構的 documentId。

GetDocumentId(SyntaxTree, ProjectId)

取得此方案中具有指定語法樹狀結構的 documentId。

GetDocumentIdsWithFilePath(String)

取得這個 SolutionFilePath 中符合指定檔案路徑之 的 集合 DocumentId

GetIsolatedSolution()
已淘汰.

先前,傳回與原始隔離的解決方案複本,使其不會共用計算狀態。 它現在不會執行任何動作。

GetLatestProjectVersion()

最近修改過的專案版本。

GetProject(IAssemblySymbol, CancellationToken)

Project取得與元件符號相關聯的 。

GetProject(ProjectId)

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

如果識別碼不是屬於此方案一部分的專案識別碼,則方法會傳回 null。

GetProjectDependencyGraph()

取得 , ProjectDependencyGraph 詳細說明此方案之專案之間的相依性。

GetSourceGeneratedDocumentAsync(DocumentId, CancellationToken)

表示一組專案及其原始程式碼檔。

RemoveAdditionalDocument(DocumentId)

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

RemoveAdditionalDocuments(ImmutableArray<DocumentId>)

建立不再包含指定之其他檔的新解決方案實例。

RemoveAnalyzerConfigDocument(DocumentId)

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

RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId>)

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

RemoveAnalyzerReference(AnalyzerReference)

建立新的方案實例,並將指定的專案更新為不再包含指定的分析器參考。

RemoveAnalyzerReference(ProjectId, AnalyzerReference)

建立新的方案實例,並將指定的專案更新為不再包含指定的分析器參考。

RemoveDocument(DocumentId)

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

RemoveDocuments(ImmutableArray<DocumentId>)

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

RemoveMetadataReference(ProjectId, MetadataReference)

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

RemoveProject(ProjectId)

建立未指定專案的新方案實例。

RemoveProjectReference(ProjectId, ProjectReference)

建立新的方案實例,並將指定的專案更新為不再包含指定的專案參考。

WithAdditionalDocumentText(DocumentId, SourceText, PreservationMode)

建立新的方案實例,並將指定的其他檔更新為指定文字。

WithAdditionalDocumentText(DocumentId, TextAndVersion, PreservationMode)

建立新的方案實例,並更新其他檔,以指定文字和版本。

WithAdditionalDocumentTextLoader(DocumentId, TextLoader, PreservationMode)

建立新的方案實例,並將指定的其他檔更新為讓文字載入器提供的文字。

WithAnalyzerConfigDocumentText(DocumentId, SourceText, PreservationMode)

使用指定的分析器組態檔建立新的解決方案實例,以讓文字載入器提供的文字。

WithAnalyzerConfigDocumentText(DocumentId, TextAndVersion, PreservationMode)

使用指定的分析器組態檔,建立新的解決方案實例,以指定文字和版本。

WithAnalyzerConfigDocumentTextLoader(DocumentId, TextLoader, PreservationMode)

使用指定的分析器組態檔建立新的解決方案實例,以讓文字載入器提供的文字。

WithAnalyzerReferences(IEnumerable<AnalyzerReference>)

使用指定的分析器參考建立新的解決方案實例。

WithDocumentFilePath(DocumentId, String)

建立新的方案實例,並將指定的檔更新為具有指定的檔案路徑。

WithDocumentFolders(DocumentId, IEnumerable<String>)

建立新的方案實例,並將指定的檔更新為包含在邏輯資料夾序列中。

WithDocumentName(DocumentId, String)

建立新的方案實例,並將指定的檔更新為具有新名稱。

WithDocumentSourceCodeKind(DocumentId, SourceCodeKind)

使用指定的檔來建立新的方案實例,以指定原始程式碼種類。

WithDocumentSyntaxRoot(DocumentId, SyntaxNode, PreservationMode)

建立新的方案實例,並將指定的檔更新為具有指定語法節點根的語法樹狀結構。

WithDocumentText(DocumentId, SourceText, PreservationMode)

建立新的方案實例,並更新指定的檔,以指定文字。

WithDocumentText(DocumentId, TextAndVersion, PreservationMode)

建立新的方案實例,並更新指定的檔,以指定文字和版本。

WithDocumentText(IEnumerable<DocumentId>, SourceText, PreservationMode)

建立新的方案實例,並更新所有指定的檔,以具有相同指定的文字。

WithDocumentTextLoader(DocumentId, TextLoader, PreservationMode)

建立新的方案實例,並將指定的檔更新為讓文字載入器提供的文字。

WithOptions(OptionSet)

使用指定的 options 建立新的方案實例。

WithProjectAnalyzerReferences(ProjectId, IEnumerable<AnalyzerReference>)

使用已更新的專案建立新的方案實例,只包含指定的分析器參考。

WithProjectAssemblyName(ProjectId, String)

建立新的方案實例,並將指定的專案更新為具有新的元件名稱。

WithProjectCompilationOptions(ProjectId, CompilationOptions)

建立新的方案實例,並將指定的專案更新為具有指定的編譯選項。

WithProjectCompilationOutputInfo(ProjectId, CompilationOutputInfo)

使用指定的專案建立新的方案實例,以讓編譯器輸出檔路徑更新。

WithProjectDefaultNamespace(ProjectId, String)

建立新的方案實例,並將指定的專案更新為具有預設命名空間。

WithProjectDocumentsOrder(ProjectId, ImmutableList<DocumentId>)

依照指定的檔識別碼的順序,建立具有專案檔案的新方案實例。 指定的檔識別碼必須與專案中已有的專案相同;不允許新增或移除。

WithProjectFilePath(ProjectId, String)

建立新的方案實例,並將指定的專案更新為具有專案檔路徑。

WithProjectMetadataReferences(ProjectId, IEnumerable<MetadataReference>)

建立新的方案實例,並更新指定的專案,只包含指定的中繼資料參考。

WithProjectName(ProjectId, String)

建立新的方案實例,其中包含指定的專案已更新為具有名稱。

WithProjectOutputFilePath(ProjectId, String)

建立新的方案實例,其中包含指定的專案已更新為具有輸出檔路徑。

WithProjectOutputRefFilePath(ProjectId, String)

建立新的方案實例,其中包含指定的專案已更新為具有參考元件輸出檔路徑。

WithProjectParseOptions(ProjectId, ParseOptions)

建立新的方案實例,並將指定的專案更新為具有指定的剖析選項。

WithProjectReferences(ProjectId, IEnumerable<ProjectReference>)

建立新的方案實例,其中指定的專案已更新,以包含指定的專案參考清單。

適用於