This documentation is archived and is not being maintained.
ProjectRootElement Class
Visual Studio 2010
Represents an MSBuild project, a targets file, or any other file that conforms to MSBuild project file schema. This class and its related classes allow a complete MSBuild project or targets file to be read and written.
System::Object
Microsoft.Build.Construction::ProjectElement
Microsoft.Build.Construction::ProjectElementContainer
Microsoft.Build.Construction::ProjectRootElement
Microsoft.Build.Construction::ProjectElement
Microsoft.Build.Construction::ProjectElementContainer
Microsoft.Build.Construction::ProjectRootElement
Assembly: Microsoft.Build (in Microsoft.Build.dll)
The ProjectRootElement type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AllChildren | Gets a recursive depth-first enumerator over all child elements. (Inherited from ProjectElementContainer.) |
![]() | AllParents | All parent elements of this element, going up to the ProjectRootElement. (Inherited from ProjectElement.) |
![]() | Children | Gets all child elements. (Inherited from ProjectElementContainer.) |
![]() | ChildrenReversed | Gets all child elements, starting from the last child. (Inherited from ProjectElementContainer.) |
![]() | ChooseElements | Gets all child Choose Element (MSBuild) in this project. |
![]() | Condition | Gets a nonexistent condition, which is implicitly true. (Overrides ProjectElement::Condition.) |
![]() | ContainingProject | Gets the project root container that contains this project. (Inherited from ProjectElement.) |
![]() | Count | Gets the number of child elements. (Inherited from ProjectElementContainer.) |
![]() | DefaultTargets | Gets or sets the value of the DefaultTargets attribute. |
![]() | DirectoryPath | Gets the directory path to the project file. |
![]() | Encoding | Specifies the character encoding that the project file is to be saved in. |
![]() | FirstChild | Gets the first child element. (Inherited from ProjectElementContainer.) |
![]() | FullPath | Gets the full path to the project file. |
![]() | HasUnsavedChanges | Determines whether the project has been modified since it was last loaded or saved. |
![]() | ImportGroups | Gets all the child import groups in this project. |
![]() | ImportGroupsReversed | Gets all the child import groups in this project, starting with the last group. |
![]() | Imports | Gets all the child import elements in this project. |
![]() | InitialTargets | Gets or sets the value of the InitialTargets attribute. |
![]() | ItemDefinitionGroups | Gets all the child item definition groups in this project. |
![]() | ItemDefinitionGroupsReversed | Gets all the child item definition groups in this project, starting with the last group. |
![]() | ItemDefinitions | Gets all child item definitions in all item definition groups anywhere in this project. |
![]() | ItemGroups | Gets all the child item groups in this project. |
![]() | ItemGroupsReversed | Gets all the child item groups present in this project, starting with the last group. |
![]() | Items | Gets all child items in this project. |
![]() | Label | Gets or sets the Label value. (Inherited from ProjectElement.) |
![]() | LastChild | Gets the last child element. (Inherited from ProjectElementContainer.) |
![]() | LastWriteTimeWhenRead | Gets the last-write-time of the project file. |
![]() | NextSibling | Gets the next sibling of this project element. (Inherited from ProjectElement.) |
![]() | Parent | Gets the project element container that contains this project. (Inherited from ProjectElement.) |
![]() | PreviousSibling | Gets the previous sibling of this project element. (Inherited from ProjectElement.) |
![]() | Properties | Gets all the child properties in this project. |
![]() | PropertyGroups | Gets all the child property groups in this project. |
![]() | PropertyGroupsReversed | Gets all the child property groups present in this project, starting with the last group. |
![]() | RawXml | Gets the XML content that represents this project. |
![]() | Targets | Gets all the child targets in this project. |
![]() | TimeLastChanged | Gets the time that this project was last modified. |
![]() | ToolsVersion | Gets or sets the value of the ToolsVersion attribute. |
![]() | UsingTasks | Gets all child UsingTask Element (MSBuild) in this project. |
![]() | Version | Gets the version number of this object. |
| Name | Description | |
|---|---|---|
![]() | AddImport | Adds a project import to this project. |
![]() | AddImportGroup | Creates an import group at the end of this project. |
![]() | AddItem(String, String) | Adds an item to this project. |
![]() | AddItem(String, String, IEnumerable<KeyValuePair<String, String>>) | Adds an item with metadata to this project. |
![]() | AddItemDefinition | Adds an item definition to this project. |
![]() | AddItemDefinitionGroup | Adds an item definition group to this project. |
![]() | AddItemGroup | Creates and adds an item group to this project. |
![]() | AddProperty | Updates or adds a property to this project. |
![]() | AddPropertyGroup | Adds a new property group to this project. |
![]() | AddTarget | Adds a target to the project. |
![]() | AddUsingTask | Adds a UsingTask Element (MSBuild) to the project. |
![]() | AppendChild | Appends the child element as the last child of this project container. (Inherited from ProjectElementContainer.) |
![]() ![]() | Create() | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the global project collection. |
![]() ![]() | Create(ProjectCollection) | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the specified project collection. |
![]() ![]() | Create(String) | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the global project collection. The new project root is initialized from data found at the specified file path. |
![]() ![]() | Create(XmlReader) | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the global project collection. The new project root is initialized from data read from the specified XmlReader. |
![]() ![]() | Create(String, ProjectCollection) | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the specified project collection. The new project root is initialized from data found at the specified file path. |
![]() ![]() | Create(XmlReader, ProjectCollection) | Creates and initializes an in-memory, empty ProjectRootElement instance and adds it to the specified project collection. The new project root is initialized from data read from the specified XmlReader. |
![]() | CreateChooseElement | Creates a Choose Element (MSBuild). |
![]() | CreateImportElement | Creates an Import Element (MSBuild). |
![]() | CreateImportGroupElement | Creates an import group. |
![]() | CreateItemDefinitionElement | Creates an item definition. |
![]() | CreateItemDefinitionGroupElement | Creates an item definition group. |
![]() | CreateItemElement(String) | Creates an item. |
![]() | CreateItemElement(String, String) | Creates an item with the specifed Include value. |
![]() | CreateItemGroupElement | Creates an item group. |
![]() | CreateMetadataElement(String) | Creates a metadata node with the specified name. |
![]() | CreateMetadataElement(String, String) | Creates a metadata node with the specified name and value. |
![]() | CreateOnErrorElement | Creates an OnError Element (MSBuild). |
![]() | CreateOtherwiseElement | Creates an Otherwise Element (MSBuild). Caller must add it to the location of choice in the project. |
![]() | CreateOutputElement | Creates an Output Element (MSBuild). |
![]() | CreateProjectExtensionsElement | Creates a ProjectExtensions Element (MSBuild). |
![]() | CreatePropertyElement | Creates a property. |
![]() | CreatePropertyGroupElement | Creates a property group. |
![]() | CreateTargetElement | Creates a target. |
![]() | CreateTaskElement | Creates a task. |
![]() | CreateUsingTaskBodyElement | Creates a task to be referenced by a UsingTask Element (MSBuild). |
![]() | CreateUsingTaskElement | Adds a UsingTask Element (MSBuild) to the project. |
![]() | CreateUsingTaskParameterElement | Creates a parameter for use in a UsingTask Element (MSBuild) parameter group. |
![]() | CreateUsingTaskParameterGroupElement | Creates a parameter group for a UsingTask Element (MSBuild). |
![]() | CreateWhenElement | Creates a When Element (MSBuild) with a specified Condition attribute. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | InsertAfterChild | Inserts the child element after the reference element. (Inherited from ProjectElementContainer.) |
![]() | InsertBeforeChild | Inserts the child element before the reference element. (Inherited from ProjectElementContainer.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | Open(String) | Initializes a project root in the global project collection by loading data from the specified file path. |
![]() ![]() | Open(String, ProjectCollection) | Initializes a project root in the specified project collection by loading data from the specified file path. |
![]() | PrependChild | Prepends the child element as the first child of this project container. (Inherited from ProjectElementContainer.) |
![]() | RemoveAllChildren | Removes all the children, if any, from this project container. (Inherited from ProjectElementContainer.) |
![]() | RemoveChild | Removes a child element from this project container. (Inherited from ProjectElementContainer.) |
![]() | Save() | Saves the project, if modified, to the file system. |
![]() | Save(Encoding) | Saves the project, if modified, using the specified character encoding. |
![]() | Save(String) | Saves the project, if modified or if the file path to storage has changed. |
![]() | Save(TextWriter) | Saves the project to the specified text writer, whether modified or not. |
![]() | Save(String, Encoding) | Saves the project, if modified or if the file path to storage has changed. Uses the specified character encoding.. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | TryOpen(String) | Gets the project root in the global project collection that was loaded into memory from the specified file path. or null if it is not currently in memory. |
![]() ![]() | TryOpen(String, ProjectCollection) | Gets the project root in the specified project collection that was loaded into memory from the specified file path. or null if it is not currently in memory. |
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:
