This documentation is archived and is not being maintained.
Project Class
Visual Studio 2010
Represents a project with design time semantics. This class can load project files, edit items and properties and build projects.
Assembly: Microsoft.Build (in Microsoft.Build.dll)
The Project type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Project() | Constructs an empty project using the global project collection global properties and default tools version. |
![]() | Project(ProjectCollection) | Constructs an empty project using the given project collection global properties and default tools version. |
![]() | Project(ProjectRootElement) | Constructs an empty project and evaluates it using the given project root and the global project collection global properties and default tools version. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
![]() | Project(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. |
| Name | Description | |
|---|---|---|
![]() | AllEvaluatedItemDefinitionMetadata | Gets all item definition metadata encountered during evaluation. |
![]() | AllEvaluatedItems | Gets an enumerator over all items encountered during evaluation. These are read during the third evaluation pass. |
![]() | AllEvaluatedProperties | Gets all properties encountered during evaluation. |
![]() | ConditionedProperties | Gets a collection of possible property values for properties used to evaluate conditions found on properties, property groups, imports, and whens. |
![]() | DirectoryPath | Gets the root directory for this project. |
![]() | DisableMarkDirty | 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. |
![]() | EvaluationCounter | Gets a number that is incremented every time that project is re-evaluated. |
![]() | FullPath | Gets or sets the full path to the project source file. |
![]() | GlobalProperties | Gets a dictionary of the global properties used for the evaluation of this project. |
![]() | Imports | Gets a list of all the files that contributed to the evaluation of this project. |
![]() | ImportsIncludingDuplicates | Gets a list of duplicate imports if an import was imported multiple times. However, only the first import was used in evaluation. |
![]() | IsBuildEnabled | Gets or sets a property that selects whether the targets and tasks of this project can be built. |
![]() | IsDirty | Gets a property that indicates whether this project has been modified so that it must be reevaluated. |
![]() | ItemDefinitions | Gets a dictionary of item definitions in this project, keyed by item type. |
![]() | Items | Gets an enumerator over all items in this project, ordered within groups of item types. |
![]() | ItemsIgnoringCondition | Gets an enumerator over all items in this project, ordered within groups of item types. |
![]() | ItemTypes | Gets an enumerator over all item types in this project. |
![]() | ProjectCollection | Gets the project collection which contains this project. |
![]() | Properties | Gets an enumerator over all properties in this project. This is an unordered collection. |
![]() | SkipEvaluation | 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. |
![]() | Targets | Gets a dictionary of all targets in this project, keyed by target name. |
![]() | ToolsVersion | Gets the tools version that this project was evaluated with, if any. |
![]() | Xml | Gets the root project associated with this project. Can never be null |
| Name | Description | |
|---|---|---|
![]() | AddItem(String, String) | Adds an item with no metadata to the project. |
![]() | AddItem(String, String, IEnumerable<KeyValuePair<String, String>>) | Adds an item with the given metadata to the project. |
![]() | AddItemFast(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. |
![]() | AddItemFast(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. |
![]() | Build() | Builds this project, using the default targets. |
![]() | Build(ILogger) | Builds this project, using the default targets and the given logger. |
![]() | Build(IEnumerable<ILogger>) | Builds this project, using the default targets and the given loggers. |
![]() | Build(String) | Builds this project, building the given target. |
![]() | Build(array<String>) | Builds this project, building the given targets. |
![]() | Build(IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>) | Builds this project, using the default targets and the given loggers and remote loggers. |
![]() | Build(String, IEnumerable<ILogger>) | Builds this project, building the given target and using the given loggers. |
![]() | Build(array<String>, IEnumerable<ILogger>) | Builds this project, building the given targets and using the given loggers. |
![]() | Build(String, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>) | Builds this project, building the given target and using the given loggers and remote loggers. |
![]() | Build(array<String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>) | Builds this project, building the given targets and using the given loggers and remote loggers. |
![]() | CreateProjectInstance | Creates a project instance based on this project, but completely disconnected from it. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | ExpandString | 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. |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | GetEvaluatedItemIncludeEscaped(ProjectItem) | Gets evaluated, escaped value of the Include attribute of the provided items. |
![]() ![]() | GetEvaluatedItemIncludeEscaped(ProjectItemDefinition) | Gets the evaluated, escaped value of the Include attribute of the provided item definition. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetItems | 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. |
![]() | GetItemsByEvaluatedInclude | Gets all items that have the given evaluated Include attribute. |
![]() | GetItemsIgnoringCondition | 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. |
![]() | GetLogicalProject | 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. |
![]() ![]() | GetMetadataValueEscaped(ProjectMetadata) | Gets the escaped value of the provided metadatum. |
![]() ![]() | GetMetadataValueEscaped(ProjectItem, String) | Gets the escaped value of the metadatum with the provided name on the provided item. |
![]() ![]() | GetMetadataValueEscaped(ProjectItemDefinition, String) | Gets the escaped value of the metadatum with the provided name on the provided item definition. |
![]() | GetProperty | Gets any property in the project that has the specified name. |
![]() | GetPropertyValue | Gets the value of the given property in this project. |
![]() ![]() | GetPropertyValueEscaped | Get the escaped value of the provided property. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MarkDirty | Marks this project as modified. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ReevaluateIfNecessary | Reevaluates the project to incorporate any changes. |
![]() | RemoveGlobalProperty | Removes a global property and marks the project as modified. |
![]() | RemoveItem | 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. |
![]() | RemoveItems | Removes all the given items from the project, unless they originate from an imported project. |
![]() | RemoveProperty | 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. |
![]() | Save() | Saves the project to the file system, if modified, using the default character encoding. |
![]() | Save(Encoding) | Saves the project to the file system, if modified, using the given character encoding. |
![]() | Save(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. |
![]() | Save(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. |
![]() | Save(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. |
![]() | SaveLogicalProject | Saves a "logical" or "preprocessed" project file, that includes all the imported files as if they formed a single file. |
![]() | SetGlobalProperty | Sets a global property after the project has been evaluated. If the value changes, the project is marked to require reevaluation. |
![]() | SetProperty | 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. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
