ProjectCollection Class
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.
MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Inheritance Hierarchy
System.Object
Microsoft.Build.Evaluation.ProjectCollection
Namespace: Microsoft.Build.Evaluation
Assembly: Microsoft.Build (in Microsoft.Build.dll)
Syntax
'Declaration
Public Class ProjectCollection _
Implements IDisposable
public class ProjectCollection : IDisposable
public ref class ProjectCollection : IDisposable
type ProjectCollection =
class
interface IDisposable
end
public class ProjectCollection implements IDisposable
The ProjectCollection type exposes the following members.
Constructors
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.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ProjectCollection(ToolsetDefinitionLocations) | Creates a project collection with no global properties or loggers. The project collection toolset is initialized from toolsets in the given locations.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ProjectCollection(IDictionary<String, String>, IEnumerable<ILogger>, ToolsetDefinitionLocations) | Instantiates a project collection with specified global properties and loggers and using the specified toolset locations.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
Top
Properties
Name | Description | |
---|---|---|
Count | Gets the number of projects currently loaded into this collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
DefaultToolsVersion | Gets the default tools version of this project collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
GlobalProjectCollection | Gets the global project collection object. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
GlobalProperties | Gets the read-only default global properties for all projects in this collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
HostServices | Gets or sets an object that provides host services to tasks during builds of projects contained in the project collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
IsBuildEnabled | Gets or sets a property that selects by default whether the targets and tasks of projects in the project collection can be built.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
LoadedProjects | Gets all the projects currently loaded into this collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Loggers | Gets all loggers that projects in this collection can use for their builds. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
OnlyLogCriticalEvents | Gets or sets a switch that determines whether only critical events such as warnings and errors are logged.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ToolsetLocations | Gets the locations used to find the toolsets.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Toolsets | Gets the toolsets available to this project collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Version | Gets the file version of the assembly file that contains the MSBuild engine.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
Top
Methods
Name | Description | |
---|---|---|
AddToolset | Adds a new toolset to the project collection. Replaces any existing toolset with the same tools version.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ContainsToolset | Determines whether a toolset is defined for the given tools version.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Dispose() | Releases both managed and unmanaged resources. Called when a host no longer needs the project collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Equals | (Inherited from Object.) | |
Escape | Converts special characters in a string to MSBuild escape format. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Finalize | (Inherited from Object.) | |
GetEffectiveToolsVersion | Figure out what ToolsVersion is used to actually build the project. | |
GetGlobalProperty | Get any global property on the project collection that has the specified name.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
GetHashCode | (Inherited from Object.) | |
GetLoadedProjects | Gets all projects whose project path matches the given path. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
GetToolset | Get the toolset with the specified tools version. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
GetType | (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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
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. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
MemberwiseClone | (Inherited from Object.) | |
RegisterForwardingLoggers | Adds the given remote loggers to the collection of remote loggers used for builds of projects in this collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
RegisterLogger | Adds the given logger to the collection of loggers used for builds of projects in this collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
RegisterLoggers | Adds the given loggers to the collection of loggers used for builds of projects in this collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
RemoveAllToolsets | Removes all toolsets from the project collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
RemoveGlobalProperty | Removes a global property from the set of default global properties.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
RemoveToolset | Removes a toolset from the project collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
SetGlobalProperty | Sets the value of a property in the default set of global properties.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ToString | (Inherited from Object.) | |
TryUnloadProject | Attempts to remove a project from the collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
Unescape | Converts escaped characters in a string to MSBuild characters with special meaning. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
UnloadAllProjects | Removes all projects in this project collection. MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
UnloadProject(Project) | Removes the given project from the project collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
UnloadProject(ProjectRootElement) | Removes a project root element from the project root cache.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
UnregisterAllLoggers | Removes all loggers from the collection of loggers used by project builds in this collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
Top
Events
Name | Description | |
---|---|---|
ProjectAdded | Event that is fired when a project is added to the ProjectRootElementCache of this project collection.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ProjectChanged | Raised when a Project contained by this instance is directly changed.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ProjectCollectionChanged | Raised when state is changed on this instance.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. | |
ProjectXmlChanged | Raised when a ProjectRootElement contained by this instance is changed.MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
Top
Remarks
Multiple project collections can exist within an app domain. However, these must not build concurrently.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.