Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ProjectCollection Class

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.

System.Object
  Microsoft.Build.Evaluation.ProjectCollection

Namespace:  Microsoft.Build.Evaluation
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

public class ProjectCollection : IDisposable

The ProjectCollection type exposes the following members.

  NameDescription
Public methodProjectCollection()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.
Public methodProjectCollection(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.
Public methodProjectCollection(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.
Public methodProjectCollection(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.
Public methodProjectCollection(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

  NameDescription
Public propertyCountGets 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.
Public propertyDefaultToolsVersionGets 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.
Public propertyDisableMarkDirtyGets 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.
Public propertyStatic memberGlobalProjectCollectionGets 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.
Public propertyGlobalPropertiesGets 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.
Public propertyHostServicesGets 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.
Public propertyIsBuildEnabledGets 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.
Public propertyLoadedProjectsGets 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.
Public propertyLoggersGets 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.
Public propertyOnlyLogCriticalEventsGets 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.
Public propertySkipEvaluationGets 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.
Public propertyToolsetLocationsGets 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.
Public propertyToolsetsGets 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.
Public propertyStatic memberVersionGets 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

  NameDescription
Public methodAddToolsetAdds 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.
Public methodContainsToolsetDetermines 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.
Public methodDispose()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.
Protected methodDispose(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.
Public methodEquals (Inherited from Object.)
Public methodStatic memberEscapeConverts 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.
Protected methodFinalize (Inherited from Object.)
Public methodGetEffectiveToolsVersionFigure out what ToolsVersion is used to actually build the project.
Public methodGetGlobalPropertyGet 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.
Public methodGetHashCode (Inherited from Object.)
Public methodGetLoadedProjectsGets 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.
Public methodGetToolsetGet 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.
Public methodGetType (Inherited from Object.)
Public methodLoadProject(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.
Public methodLoadProject(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.
Public methodLoadProject(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.
Public methodLoadProject(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.
Public methodLoadProject(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.
Public methodLoadProject(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.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRegisterForwardingLoggersAdds 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.
Public methodRegisterLoggerAdds 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.
Public methodRegisterLoggersAdds 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.
Public methodRemoveAllToolsetsRemoves 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.
Public methodRemoveGlobalPropertyRemoves 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.
Public methodRemoveToolsetRemoves 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.
Public methodSetGlobalPropertySets 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.
Public methodToString (Inherited from Object.)
Public methodTryUnloadProjectAttempts 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.
Public methodStatic memberUnescapeConverts 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.
Public methodUnloadAllProjectsRemoves 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.
Public methodUnloadProject(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.
Public methodUnloadProject(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.
Public methodUnregisterAllLoggersRemoves 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

  NameDescription
Public eventProjectAddedEvent 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.
Public eventProjectChangedRaised 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.
Public eventProjectCollectionChangedRaised 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.
Public eventProjectXmlChangedRaised 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

Multiple project collections can exist within an app domain. However, these must not build concurrently.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft