Project Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Represents a project with design time semantics. This class can load project files, edit items and properties and build projects.

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

System.Object
  Microsoft.Build.Evaluation.Project

public class Project

NameDescription
System_CAPS_pubmethodProject()

Constructs an empty project using the global project collection global properties and default tools version.

System_CAPS_pubmethodProject(IDictionary<String, String>, String, ProjectCollection)

Constructs an empty project, to be evaluated with the given project collection and with the given global properties and given tools version.

System_CAPS_pubmethodProject(ProjectCollection)

Constructs an empty project using the given project collection global properties and default tools version.

System_CAPS_pubmethodProject(ProjectRootElement)

Constructs an empty project and evaluates it using the given project root and the global project collection global properties and default tools version.

System_CAPS_pubmethodProject(ProjectRootElement, IDictionary<String, String>, String)

Constructs an empty project and evaluates it using the given project root and with the given global properties and given tools version.

System_CAPS_pubmethodProject(ProjectRootElement, IDictionary<String, String>, String, ProjectCollection)

Constructs a project and evaluates it using the given project root and with the given global properties and given tools version.

System_CAPS_pubmethodProject(ProjectRootElement, IDictionary<String, String>, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates it using the given project root and with the given global properties, given tools version, and given load settings.

System_CAPS_pubmethodProject(ProjectRootElement, IDictionary<String, String>, String, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates it using the given project root and with the given global properties, tools and sub-toolset versions, project collection, and load settings.

System_CAPS_pubmethodProject(String)

Constructs a project and evaluates it from the given source project file and with the global project collection global properties and default tools version.

System_CAPS_pubmethodProject(String, IDictionary<String, String>, String)

Constructs a project and evaluates it from the given source project file and with the given global properties and given tools version.

System_CAPS_pubmethodProject(String, IDictionary<String, String>, String, ProjectCollection)

Constructs a project and evaluates it from the given source project file and with the given global properties and given tools version.

System_CAPS_pubmethodProject(String, IDictionary<String, String>, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates it from the given source project file and with the given global properties, given tools version, and given load settings.

System_CAPS_pubmethodProject(String, IDictionary<String, String>, String, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates it from the given source project file and with the given global properties, tools and sub-toolset versions, project collection, and load settings.

System_CAPS_pubmethodProject(XmlReader)

Constructs a project and evaluates the source code from the given XML reader. The source code is evaluated with the global project collection global properties and default tools version.

System_CAPS_pubmethodProject(XmlReader, IDictionary<String, String>, String)

Constructs a project and evaluates the source code from the given XML reader. The source code is evaluated with the given global properties and given tools version.

System_CAPS_pubmethodProject(XmlReader, IDictionary<String, String>, String, ProjectCollection)

Constructs a project and evaluates the source code from the given XML reader. The source code is evaluated with the given global properties and given tools version.

System_CAPS_pubmethodProject(XmlReader, IDictionary<String, String>, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates the source code from the given XML reader. The source code is evaluated with the given global properties and given tools version.

System_CAPS_pubmethodProject(XmlReader, IDictionary<String, String>, String, String, ProjectCollection, ProjectLoadSettings)

Constructs a project and evaluates the source code from the given XML reader. The source code is evaluated with the given global properties, tools and sub-toolset versions, project collection, and load settings.

NameDescription
System_CAPS_pubpropertyAllEvaluatedItemDefinitionMetadata

Gets all item definition metadata encountered during evaluation.

System_CAPS_pubpropertyAllEvaluatedItems

Gets an enumerator over all items encountered during evaluation. These are read during the third evaluation pass.

System_CAPS_pubpropertyAllEvaluatedProperties

Gets all properties encountered during evaluation.

System_CAPS_pubpropertyConditionedProperties

Gets a collection of possible property values for properties used to evaluate conditions found on properties, property groups, imports, and whens.

System_CAPS_pubpropertyDirectoryPath

Gets the root directory for this project.

System_CAPS_pubpropertyDisableMarkDirty

Gets or sets a flag the determines whether MarkDirty is temporarily disabled. This allows, for example, a global property to be set without the project getting marked dirty for reevaluation as a consequence.

System_CAPS_pubpropertyEvaluationCounter

Gets a number that is incremented every time that project is re-evaluated.

System_CAPS_pubpropertyFullPath

Gets or sets the full path to the project source file.

System_CAPS_pubpropertyGlobalProperties

Gets a dictionary of the global properties used for the evaluation of this project.

System_CAPS_pubpropertyImports

Gets a list of all the files that contributed to the evaluation of this project.

System_CAPS_pubpropertyImportsIncludingDuplicates

Gets a list of duplicate imports if an import was imported multiple times. However, only the first import was used in evaluation.

System_CAPS_pubpropertyIsBuildEnabled

Gets or sets a property that selects whether the targets and tasks of this project can be built.

System_CAPS_pubpropertyIsDirty

Gets a property that indicates whether this project has been modified so that it must be reevaluated.

System_CAPS_pubpropertyItemDefinitions

Gets a dictionary of item definitions in this project, keyed by item type.

System_CAPS_pubpropertyItems

Gets an enumerator over all items in this project, ordered within groups of item types.

System_CAPS_pubpropertyItemsIgnoringCondition

Gets an enumerator over all items in this project, ordered within groups of item types.

System_CAPS_pubpropertyItemTypes

Gets an enumerator over all item types in this project.

System_CAPS_pubpropertyProjectCollection

Gets the project collection which contains this project.

System_CAPS_pubpropertyProjectFileLocation

The location of the originating file itself, not any specific content within it. If the file has not been given a name, this is an empty location. This is a legitimate case of having no location.

System_CAPS_pubpropertyProperties

Gets an enumerator over all properties in this project. This is an unordered collection.

System_CAPS_pubpropertySkipEvaluation

Gets or sets a flag the determines whether ReevaluateIfNecessary is temporarily disabled. This is useful when the host expects to make a number of reads and writes to the project, and wants to temporarily sacrifice correctness for performance.

System_CAPS_pubpropertySubToolsetVersion

Gets the value of the SubToolsetVersion attribute, if any. This value was combined with the value of the ToolsVersion attribute to determine the toolset properties for this project.

System_CAPS_pubpropertyTargets

Gets a dictionary of all targets in this project, keyed by target name.

System_CAPS_pubpropertyToolsVersion

Gets the tools version that this project was evaluated with, if any.

System_CAPS_pubpropertyXml

Gets the root project associated with this project. Can never be null

NameDescription
System_CAPS_pubmethodAddItem(String, String)

Adds an item with no metadata to the project.

System_CAPS_pubmethodAddItem(String, String, IEnumerable<KeyValuePair<String, String>>)

Adds an item with the given metadata to the project.

System_CAPS_pubmethodAddItemFast(String, String)

Adds an item with no metadata to the project. Makes no effort to see if an existing wildcard would already match the new item, unless it is the first item in an item group. Makes no effort to locate the new item near similar items.

System_CAPS_pubmethodAddItemFast(String, String, IEnumerable<KeyValuePair<String, String>>)

Adds an item with metadata to the project. Metadata may be null, indicating no metadata. Makes no effort to see if an existing wildcard would already match the new item, unless it is the first item in an item group. Makes no effort to locate the new item near similar items.

System_CAPS_pubmethodBuild()

Builds this project, using the default targets.

System_CAPS_pubmethodBuild(IEnumerable<ILogger>)

Builds this project, using the default targets and the given loggers.

System_CAPS_pubmethodBuild(IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>)

Builds this project, using the default targets and the given loggers and remote loggers.

System_CAPS_pubmethodBuild(ILogger)

Builds this project, using the default targets and the given logger.

System_CAPS_pubmethodBuild(String)

Builds this project, building the given target.

System_CAPS_pubmethodBuild(String, IEnumerable<ILogger>)

Builds this project, building the given target and using the given loggers.

System_CAPS_pubmethodBuild(String, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>)

Builds this project, building the given target and using the given loggers and remote loggers.

System_CAPS_pubmethodBuild(String[])

Builds this project, building the given targets.

System_CAPS_pubmethodBuild(String[], IEnumerable<ILogger>)

Builds this project, building the given targets and using the given loggers.

System_CAPS_pubmethodBuild(String[], IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>)

Builds this project, building the given targets and using the given loggers and remote loggers.

System_CAPS_pubmethodCreateProjectInstance()

Creates a project instance based on this project, but completely disconnected from it.

System_CAPS_pubmethodCreateProjectInstance(ProjectInstanceSettings)

Creates a project instance based on this project, but completely disconnected from it.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodExpandString(String)

Evaluates the given string by expanding items and properties. The string is evaluated as if it were found at the very end of the project file.

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetEvaluatedItemIncludeEscaped(ProjectItem)

Gets evaluated, escaped value of the Include attribute of the provided items.

System_CAPS_pubmethodSystem_CAPS_staticGetEvaluatedItemIncludeEscaped(ProjectItemDefinition)

Gets the evaluated, escaped value of the Include attribute of the provided item definition.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetItems(String)

Gets all the items in the project of the given item type. If there are none, returns an empty list. Use AddItem or RemoveItem to modify items in this project.

System_CAPS_pubmethodGetItemsByEvaluatedInclude(String)

Gets all items that have the given evaluated Include attribute.

System_CAPS_pubmethodGetItemsIgnoringCondition(String)

Gets all the items in the project of the given type, whether or not their Condition attribute evaluates to true. This is a read-only list: use AddItem or RemoveItem to modify items in this project.

System_CAPS_pubmethodGetLogicalProject()

Gets an enumerator over all the elements in the "logical project". The logical project is defined as the unevaluated project obtained from the single MSBuild file that is the result of inlining the text of all imports of the original MSBuild project manifest file.

System_CAPS_pubmethodSystem_CAPS_staticGetMetadataValueEscaped(ProjectItem, String)

Gets the escaped value of the metadatum with the provided name on the provided item.

System_CAPS_pubmethodSystem_CAPS_staticGetMetadataValueEscaped(ProjectItemDefinition, String)

Gets the escaped value of the metadatum with the provided name on the provided item definition.

System_CAPS_pubmethodSystem_CAPS_staticGetMetadataValueEscaped(ProjectMetadata)

Gets the escaped value of the provided metadatum.

System_CAPS_pubmethodGetProperty(String)

Gets any property in the project that has the specified name.

System_CAPS_pubmethodGetPropertyValue(String)

Gets the value of the given property in this project.

System_CAPS_pubmethodSystem_CAPS_staticGetPropertyValueEscaped(ProjectProperty)

Get the escaped value of the provided property.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodMarkDirty()

Marks this project as modified.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodReevaluateIfNecessary()

Reevaluates the project to incorporate any changes.

System_CAPS_pubmethodRemoveGlobalProperty(String)

Removes a global property and marks the project as modified.

System_CAPS_pubmethodRemoveItem(ProjectItem)

Removes an item from the project. The item to be removed must be present in the project, and must not originate from an imported file.

System_CAPS_pubmethodRemoveItems(IEnumerable<ProjectItem>)

Removes all the given items from the project, unless they originate from an imported project.

System_CAPS_pubmethodRemoveProperty(ProjectProperty)

Removes an property from the project. The property to be removed must be present in the project, and must not originate from an imported file.

System_CAPS_pubmethodSave()

Saves the project to the file system, if modified, using the default character encoding.

System_CAPS_pubmethodSave(Encoding)

Saves the project to the file system, if modified, using the given character encoding.

System_CAPS_pubmethodSave(String)

Saves the project to the file system, if modified or if the path to the project source code changes, using the default character encoding.

System_CAPS_pubmethodSave(String, Encoding)

Saves the project to the file system, if modified or if the path to the project source code changes, using the given character encoding.

System_CAPS_pubmethodSave(TextWriter)

Saves the project to the provided text writer, whether or not the project has been modified. Uses the character encoding of the text writer and marks the project as unmodified.

System_CAPS_pubmethodSaveLogicalProject(TextWriter)

Saves a "logical" or "preprocessed" project file, that includes all the imported files as if they formed a single file.

System_CAPS_pubmethodSetGlobalProperty(String, String)

Sets a global property after the project has been evaluated. If the value changes, the project is marked to require reevaluation.

System_CAPS_pubmethodSetProperty(String, String)

Sets or adds a property with the given name and value to the project. Overwrites the value of a property with the same name if it did not originate in an imported file.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

.NET Framework
Available since 4.0

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

Return to top
Show: