ProjectCollection Class
.NET Framework 4.5
Encapsulates a set of related projects, their toolsets, a default set of global properties, and the loggers that should be used to build them. A global version of this class acts as the default project collection.
Namespace:
Microsoft.Build.Evaluation
Assembly: Microsoft.Build (in Microsoft.Build.dll)
The ProjectCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ProjectCollection() | Creates a project collection with no global properties or loggers. The project collection toolset is initialized from the configuration file and registry. |
![]() | ProjectCollection(IDictionary<String, String>) | Instantiates a project collection with specified global properties, no loggers, and that reads toolset information from the configuration file and registry. |
![]() | ProjectCollection(ToolsetDefinitionLocations) | Creates a project collection with no global properties or loggers. The project collection toolset is initialized from toolsets in the given locations. |
![]() | ProjectCollection(IDictionary<String, String>, IEnumerable<ILogger>, ToolsetDefinitionLocations) | Instantiates a project collection with specified global properties and loggers and using the specified toolset locations. |
![]() | ProjectCollection(IDictionary<String, String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean) | Creates a project collection with specified global properties, loggers, node count, and onlyLogCriticalEvents value. The project collection toolset is initialized from toolsets in the given locations. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of projects currently loaded into this collection. |
![]() | DefaultToolsVersion | Gets the default tools version of this project collection. |
![]() | DisableMarkDirty | Gets or sets a flag that determines whether MarkDirty is temporarily disabled on projects in this collection. This allows, for example, a global properties to be set without projects getting marked dirty for reevaluation as a consequence. |
![]() ![]() | GlobalProjectCollection | Gets the global project collection object. |
![]() | GlobalProperties | Gets the read-only default global properties for all projects in this collection. |
![]() | HostServices | Gets or sets an object that provides host services to tasks during builds of projects contained in the project collection. |
![]() | IsBuildEnabled | Gets or sets a property that selects by default whether the targets and tasks of projects in the project collection can be built. |
![]() | LoadedProjects | Gets all the projects currently loaded into this collection. |
![]() | Loggers | Gets all loggers that projects in this collection can use for their builds. |
![]() | OnlyLogCriticalEvents | Gets or sets a switch that determines whether only critical events such as warnings and errors are logged. |
![]() | SkipEvaluation | Gets or sets a flag the determines whether ReevaluateIfNecessary is temporarily disabled on projects in this collection. This is useful when the host expects to make a number of reads and writes to projects, and wants to temporarily sacrifice correctness for performance. |
![]() | ToolsetLocations | Gets the locations used to find the toolsets. |
![]() | Toolsets | Gets the toolsets available to this project collection. |
![]() ![]() | Version | Gets the file version of the assembly file that contains the MSBuild engine. |
| Name | Description | |
|---|---|---|
![]() | AddToolset | Adds a new toolset to the project collection. Replaces any existing toolset with the same tools version. |
![]() | ContainsToolset | Determines whether a toolset is defined for the given tools version. |
![]() | Dispose() | Releases both managed and unmanaged resources. Called when a host no longer needs the project collection. |
![]() | Dispose(Boolean) | Releases both managed and unmanaged resources. Called when a host no longer needs the project collection.. Shuts down any logging services that the project collection owns and releases the logger thread. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() | Escape | Converts special characters in a string to MSBuild escape format. |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetGlobalProperty | Get any global property on the project collection that has the specified name. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLoadedProjects | Gets all projects whose project path matches the given path. |
![]() | GetToolset | Get the toolset with the specified tools version. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | LoadProject(String) | Evaluates a project from the source code in the given project file. The source code is evaluated with the global properties and tools version of this project collection. |
![]() | LoadProject(XmlReader) | Evaluates a project from the source code read from the given XML reader. The source code is evaluated with the global properties and tools version of this project collection. |
![]() | LoadProject(String, String) | Evaluates a project from the source code read from the given project file. The source code is evaluated with the global properties of this project collection and the given tools version. |
![]() | LoadProject(XmlReader, String) | Evaluates a project from the source code read from the given XML reader. The source code is evaluated with the global properties of this project collection and the given tools version. |
![]() | LoadProject(String, IDictionary<String, String>, String) | Evaluates a project from the source code read from the given project file. The source code is evaluated with the given global properties and tools version. |
![]() | LoadProject(XmlReader, IDictionary<String, String>, String) | Evaluates a project from the source code read from the given XML reader. The source code is evaluated with the given global properties and tools version. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | RegisterForwardingLoggers | Adds the given remote loggers to the collection of remote loggers used for builds of projects in this collection. |
![]() | RegisterLogger | Adds the given logger to the collection of loggers used for builds of projects in this collection. |
![]() | RegisterLoggers | Adds the given loggers to the collection of loggers used for builds of projects in this collection. |
![]() | RemoveAllToolsets | Removes all toolsets from the project collection. |
![]() | RemoveGlobalProperty | Removes a global property from the set of default global properties. |
![]() | RemoveToolset | Removes a toolset from the project collection. |
![]() | SetGlobalProperty | Sets the value of a property in the default set of global properties. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | TryUnloadProject | Attempts to remove a project from the collection. |
![]() ![]() | Unescape | Converts escaped characters in a string to MSBuild characters with special meaning. |
![]() | UnloadAllProjects | Removes all projects in this project collection. |
![]() | UnloadProject(Project) | Removes the given project from the project collection. |
![]() | UnloadProject(ProjectRootElement) | Removes a project root element from the project root cache. |
![]() | UnregisterAllLoggers | Removes all loggers from the collection of loggers used by project builds in this collection. |
| Name | Description | |
|---|---|---|
![]() | ProjectAdded | Event that is fired when a project is added to the ProjectRootElementCache of this project collection. |
![]() | ProjectChanged | Raised when a Project contained by this instance is directly changed. |
![]() | ProjectCollectionChanged | Raised when state is changed on this instance. |
![]() | ProjectXmlChanged | Raised when a ProjectRootElement contained by this instance is changed. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
