Click or drag to resize

MSBuildWorkspace Class



A workspace that can be populated by opening MSBuild solution and project files.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysisWorkspace
    Microsoft.CodeAnalysis.MSBuildMSBuildWorkspace

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

The MSBuildWorkspace type exposes the following members.

Properties
  NameDescription
Public propertyCanOpenDocuments
True if this workspace supports manually opening and closing documents.
(Inherited from Workspace.)
Public propertyCurrentSolution
The current solution. The solution is an immutable model of the current set of projects and source documents. It provides access to source text, syntax trees and semantics. This property may change as the workspace reacts to changes in the environment or after TryApplyChanges(Solution) is called.
(Inherited from Workspace.)
Public propertyDiagnostics
Diagnostics logged while opening solutions, projects and documents.
Public propertyKind
The kind of the workspace. This is generally Host if originating from the host environment, but may be any other name used for a specific kind of workspace.
(Inherited from Workspace.)
Public propertyLoadMetadataForReferencedProjects
Determines if metadata from existing output assemblies is loaded instead of opening referenced projects. If the referenced project is already opened, the metadata will not be loaded. If the metadata assembly cannot be found the referenced project will be opened instead.
Public propertyOptions
Gets or sets the set of all global options.
(Inherited from Workspace.)
Public propertyProperties
The MSBuild properties used when interpreting project files. These are the same properties that are passed to msbuild via the /property:<n>=<v> command line argument.
Public propertyServices
Services provider by the host for implementing workspace features.
(Inherited from Workspace.)
Public propertySkipUnrecognizedProjects
Determines if unrecognized projects are skipped when solutions or projects are opened. An project is unrecognized if it either has a) an invalid file path, b) a non-existent project file, c) has an unrecognized file extension or d) a file extension associated with an unsupported language. If unrecognized projects cannot be skipped a corresponding exception is thrown.
Top
Methods
  NameDescription
Public methodAssociateFileExtensionWithLanguage
Associates a project file extension with a language name.
Public methodCanApplyChange (Overrides WorkspaceCanApplyChange(ApplyChangesKind).)
Public methodCloseAdditionalDocument
Close the specified additional document in the host environment.
(Inherited from Workspace.)
Public methodCloseDocument
Close the specified document in the host environment.
(Inherited from Workspace.)
Public methodCloseSolution
Close the open solution, and reset the workspace to a new empty solution.
Public methodStatic memberCreate
Create a new instance of a workspace that can be populated by opening solution and project files.
Public methodStatic memberCreate(IDictionaryString, String)
Create a new instance of a workspace that can be populated by opening solution and project files.
Public methodStatic memberCreate(HostServices)
Create a new instance of a workspace that can be populated by opening solution and project files.
Public methodStatic memberCreate(IDictionaryString, String, HostServices)
Create a new instance of a workspace that can be populated by opening solution and project files.
Public methodDispose
Disposes this workspace. The workspace can longer be used after it is disposed.
(Inherited from Workspace.)
Public methodGetDocumentIdInCurrentContext
Gets the id for the document associated with the given text container in its current context. Documents are normally associated with a text container when the documents are opened.
(Inherited from Workspace.)
Public methodGetOpenDocumentIds (Inherited from Workspace.)
Public methodGetRelatedDocumentIds (Inherited from Workspace.)
Public methodIsDocumentOpen
Determines if the document is currently open in the host environment.
(Inherited from Workspace.)
Public methodOpenAdditionalDocument
Open the specified additional document in the host environment.
(Inherited from Workspace.)
Public methodOpenDocument
Open the specified document in the host environment.
(Inherited from Workspace.)
Public methodOpenProjectAsync
Open a project file and all referenced projects.
Public methodOpenSolutionAsync
Open a solution file and all referenced projects.
Public methodTryApplyChanges (Overrides WorkspaceTryApplyChanges(Solution).)
Top
Events
  NameDescription
Public eventDocumentActiveContextChanged
An event that is fired when the active context document associated with a buffer changes.
(Inherited from Workspace.)
Public eventDocumentClosed
An event that is fired when a document is closed in the editor.
(Inherited from Workspace.)
Public eventDocumentOpened
An event that is fired when a documents is opened in the editor.
(Inherited from Workspace.)
Public eventWorkspaceChanged
An event raised whenever the current solution is changed.
(Inherited from Workspace.)
Public eventWorkspaceFailed
An event raised whenever the workspace or part of its solution model fails to access a file or other external resource.
(Inherited from Workspace.)
Top
See Also