Click or drag to resize

Solution Class



Represents a set of projects and their source code documents.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysisSolution

Namespace:  Microsoft.CodeAnalysis
Assembly:  Microsoft.CodeAnalysis.Workspaces (in Microsoft.CodeAnalysis.Workspaces.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public class Solution

The Solution type exposes the following members.

Properties
  NameDescription
Public propertyFilePath
The path to the solution file or null if there is no solution file.
Public propertyId
The Id of the solution. Multiple solution instances may share the same Id.
Public propertyOptions
Returns the options that should be applied to this solution. This is equivalent to Options when the Solution instance was created.
Public propertyProjectIds
A list of all the ids for all the projects contained by the solution.
Public propertyProjects
A list of all the projects contained by the solution.
Public propertyVersion
The solution version. This equates to the solution file's version.
Public propertyWorkspace
The Workspace this solution is associated with.
Top
Methods
  NameDescription
Public methodAddAdditionalDocument(DocumentInfo)
Public methodAddAdditionalDocument(DocumentId, String, SourceText, IEnumerableT, Void)
Public methodAddAdditionalDocument(DocumentId, String, String, IEnumerableT, Void)
Public methodAddAnalyzerReference
Create a new solution instance with the project specified updated to include the specified analyzer reference.
Public methodAddAnalyzerReferences
Public methodAddDocument(DocumentInfo)
Create a new solution instance with the corresponding project updated to include a new document instanced defined by the document info.
Public methodAddDocument(DocumentId, String, TextLoader, IEnumerableT)
Public methodAddDocument(DocumentId, String, String, IEnumerableT, Void)
Public methodAddDocument(DocumentId, String, SourceText, IEnumerableT, Void, String)
Public methodAddDocument(DocumentId, String, SyntaxNode, IEnumerableT, Void, String, String)
Public methodAddMetadataReference
Create a new solution instance with the project specified updated to include the specified metadata reference.
Public methodAddMetadataReferences
Public methodAddProject(ProjectInfo)
Create a new solution instance that includes a project with the specified project information.
Public methodAddProject(String, String, String)
Creates a new solution instance that includes a project with the specified language and names. Returns the new project.
Public methodAddProject(ProjectId, String, String, String)
Creates a new solution instance that includes a project with the specified language and names.
Public methodAddProjectReference
Create a new solution instance with the project specified updated to include the specified project reference.
Public methodAddProjectReferences
Public methodContainsAdditionalDocument
True if the solution contains the additional document in one of its projects
Public methodContainsDocument
True if the solution contains the document in one of its projects
Public methodContainsProject
True if the solution contains a project with the specified project ID.
Public methodGetAdditionalDocument
Gets the additional document in this solution with the specified document ID.
Public methodGetChanges
Gets an objects that lists the added, changed and removed projects between this solution and the specified solution.
Public methodGetDocument(DocumentId)
Gets the document in this solution with the specified document ID.
Public methodGetDocument(SyntaxTree)
Gets the document in this solution with the specified syntax tree.
Public methodGetDocumentId(SyntaxTree)
Gets the documentId in this solution with the specified syntax tree.
Public methodGetDocumentId(SyntaxTree, ProjectId)
Gets the documentId in this solution with the specified syntax tree.
Public methodGetDocumentIdsWithFilePath
Gets the set of DocumentIds in this Solution with a FilePath that matches the given file path.
Public methodGetIsolatedSolution
Gets a copy of the solution isolated from the original so that they do not share computed state. Use isolated solutions when doing operations that are likely to access a lot of text, syntax trees or compilations that are unlikely to be needed again after the operation is done. When the isolated solution is reclaimed so will the computed state.
Public methodGetLatestProjectVersion
The version of the most recently modified project.
Public methodGetProject(ProjectId)
Gets the project in this solution with the specified project ID. If the id is not an id of a project that is part of this solution the method returns null.
Public methodGetProject(IAssemblySymbol, CancellationToken)
Gets the Project associated with an assembly symbol.
Public methodGetProjectDependencyGraph
Gets a ProjectDependencyGraph that details the dependencies between projects for this solution.
Public methodRemoveAdditionalDocument
Creates a new solution instance that no longer includes the specified additional document.
Public methodRemoveAnalyzerReference
Create a new solution instance with the project specified updated to no longer include the specified analyzer reference.
Public methodRemoveDocument
Creates a new solution instance that no longer includes the specified document.
Public methodRemoveMetadataReference
Create a new solution instance with the project specified updated to no longer include the specified metadata reference.
Public methodRemoveProject
Create a new solution instance without the project specified.
Public methodRemoveProjectReference
Create a new solution instance with the project specified updated to no longer include the specified project reference.
Public methodWithAdditionalDocumentText(DocumentId, SourceText, PreservationMode)
Creates a new solution instance with the additional document specified updated to have the text specified.
Public methodWithAdditionalDocumentText(DocumentId, TextAndVersion, PreservationMode)
Creates a new solution instance with the additional document specified updated to have the text and version specified.
Public methodWithAdditionalDocumentTextLoader
Creates a new solution instance with the additional document specified updated to have the text supplied by the text loader.
Public methodWithDocumentFilePath
Creates a new solution instance with the document specified updated to have the specified file path.
Public methodWithDocumentFolders
Public methodWithDocumentName
Creates a new solution instance with the document specified updated to have the new name.
Public methodWithDocumentSourceCodeKind
Creates a new solution instance with the document specified updated to have the source code kind specified.
Public methodWithDocumentSyntaxRoot
Creates a new solution instance with the document specified updated to have a syntax tree rooted by the specified syntax node.
Public methodWithDocumentText(IEnumerableT, Void, DocumentId)
Public methodWithDocumentText(DocumentId, SourceText, PreservationMode)
Creates a new solution instance with the document specified updated to have the text specified.
Public methodWithDocumentText(DocumentId, TextAndVersion, PreservationMode)
Creates a new solution instance with the document specified updated to have the text and version specified.
Public methodWithDocumentTextLoader
Creates a new solution instance with the document specified updated to have the text supplied by the text loader.
Public methodWithProjectAnalyzerReferences
Public methodWithProjectAssemblyName
Creates a new solution instance with the project specified updated to have the new assembly name.
Public methodWithProjectCompilationOptions
Create a new solution instance with the project specified updated to have the specified compilation options.
Public methodWithProjectFilePath
Creates a new solution instance with the project specified updated to have the project file path.
Public methodWithProjectMetadataReferences
Public methodWithProjectName
Creates a new solution instance with the project specified updated to have the name.
Public methodWithProjectOutputFilePath
Creates a new solution instance with the project specified updated to have the output file path.
Public methodWithProjectParseOptions
Create a new solution instance with the project specified updated to have the specified parse options.
Public methodWithProjectReferences
Top
See Also