Export (0) Print
Expand All

ProjectInstance Class

Represents a project instance.

System.Object
  Microsoft.Build.Execution.ProjectInstance

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

type ProjectInstance =  class end

The ProjectInstance type exposes the following members.

  NameDescription
Public methodProjectInstance(ProjectRootElement)Creates a new project instance and initializes it from the given project root, using the default project collection.
Public methodProjectInstance(String)Creates a new project instance and initializes it from the given project file, using the default project collection.
Public methodProjectInstance(String, IDictionary(String, String), String)Creates a new project instance and initializes it from the given project file, using the given global properties, tools version, and the default project collection.
Public methodProjectInstance(ProjectRootElement, IDictionary(String, String), String, ProjectCollection)Creates a new project instance and initializes it from the given project root, using the given global properties, tools version, and project collection.
Public methodProjectInstance(String, IDictionary(String, String), String, ProjectCollection)Creates a new project instance and initializes it from the given project file, using the given global properties, tools version, and project collection.
Public methodProjectInstance(ProjectRootElement, IDictionary(String, String), String, String, ProjectCollection)Creates a new project instance and initializes it from the given project root, using the given global properties, tools version, and project collection
Public methodProjectInstance(String, IDictionary(String, String), String, String, ProjectCollection)Creates a new project instance and initializes it from the given project file, using the given global properties, tools version, sub toolset version, and project collection.
Top

  NameDescription
Public propertyDefaultTargetsGets or sets the list of default targets for this project.
Public propertyDirectoryGets the project root directory. Used for evaluation of relative paths and setting the current directory during build. Is never null: projects not loaded from disk use the current directory from the time the build started.
Public propertyFullPathGets the full path to the project file. Used for logging.
Public propertyGlobalPropertiesGets the dictionary of global properties this project was evaluated with, if any.
Public propertyInitialTargetsGets the list of initial targets for the project and all its imports, depth-first. These targets are built before any other targets.
Public propertyIsImmutableGets a flag indicating that the project instance is immutable. This flag is set permanently when the instance is created.
Public propertyItemDefinitionsGets a read-only dictionary of the item definitions in the project, keyed by item type.
Public propertyItemsGets all items in this project.
Public propertyItemTypesGets all item types in this project.
Public propertyProjectFileLocationGets the location of the originating file itself. Never null.
Public propertyPropertiesGets all properties in this project.
Public propertyTargetsGets an enumerator over all targets in this project. This collection is read-only.
Public propertyToolsVersionGets the tools version this project was evaluated with, if any.
Top

  NameDescription
Public methodAddItem(String, String)Adds an item with no metadata to the project.
Public methodAddItem(String, String, IEnumerable(KeyValuePair(String, String)))Adds an item with the given metadata to the project.
Public methodBuild()Builds the default targets of the project with loggers of the project collection.
Public methodBuild(IEnumerable(ILogger))Builds the default targets of the project with the given loggers.
Public methodBuild(IEnumerable(ILogger), IEnumerable(ForwardingLoggerRecord))Builds the default targets of the project with the given loggers and remote loggers.
Public methodBuild(String, IEnumerable(ILogger))Builds the given target of the project with the given loggers.
Public methodBuild(String[], IEnumerable(ILogger))Builds the given targets of the project with the given loggers.
Public methodBuild(String, IEnumerable(ILogger), IEnumerable(ForwardingLoggerRecord))Builds the given target of the project with the given loggers and remote loggers.
Public methodBuild(String[], IEnumerable(ILogger), IDictionary(String, TargetResult))Build a list of targets with specified loggers. Targets may be null. Loggers may be null.
Public methodBuild(String[], IEnumerable(ILogger), IEnumerable(ForwardingLoggerRecord))Builds the given targets of the project with the given loggers and remote loggers.
Public methodBuild(String[], IEnumerable(ILogger), IEnumerable(ForwardingLoggerRecord), IDictionary(String, TargetResult))Builds the given targets with the given target outputs and with the given loggers and remote loggers.
Public methodDeepCopy()Creates an independent, deep clone of this project and everything in it. Clone has the same mutability as the original. Useful for compiling a single file or for keeping build results between builds.
Public methodDeepCopy(Boolean)Creates an independent, deep clone of this project and everything in it, with specified mutability. Useful for compiling a single file or for keeping build results between builds.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodEvaluateConditionEvaluates the provided string as a condition by expanding items and properties, using the current items and properties available, then doing a logical evaluation.
Public methodExpandStringEvaluates the provided string by expanding items and properties, using the current items and properties available.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberGetEvaluatedItemIncludeEscaped(ProjectItemDefinitionInstance)Gets the evaluated, escaped value of the Include attribute of the provided item definition.
Public methodStatic memberGetEvaluatedItemIncludeEscaped(ProjectItemInstance)Gets the evaluated, escaped value of the Include attribute of the provided item.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetItemsGets all the items in this project of the specified type. This is a read-only list.
Public methodGetItemsByItemTypeAndEvaluatedIncludeGets all the items in this project of the specified type and evaluated include value. This is a read-only list.
Public methodStatic memberGetMetadataValueEscaped(ProjectMetadataInstance)Gets the escaped value of the provided metadatum.
Public methodStatic memberGetMetadataValueEscaped(ProjectItemDefinitionInstance, String)Gets the escaped value of the metadatum with the provided name of the provided item definition.
Public methodStatic memberGetMetadataValueEscaped(ProjectItemInstance, String)Gets the escaped value of the metadatum with the provided name on the provided item.
Public methodGetPropertyGet the property with the given name.
Public methodGetPropertyValueGet the value of the property with the given name.
Public methodStatic memberGetPropertyValueEscapedGet the escaped value of the provided property.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveItemRemoves an item from the project, if present. Returns true if it was present, false otherwise.
Public methodRemovePropertyRemoves a property with the given name. Returns true if the property had a value (possibly empty string), otherwise false.
Public methodSetPropertyAdd a property with the specified name and value to the project. Overwrites any property with the same name already in the property collection.
Public methodToProjectRootElementCreates a ProjectRootElement from the contents of this ProjectInstance.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUpdateStateFromReplaces the project state GlobalProperties, Properties and Items with those from the specified ProjectInstance.
Top

Instances of this class result when a project is cloned. Constructors are internal in order to require users to create project instances from existing projects.

New project instances are immutable, except that instance items can be added to them and instance properties set on them. Project instances are useful because they can be modified and built several times without disturbing the original project.

Neither this class nor any of its constituents is allowed to have references to Microsoft.Build.Construction or Microsoft.Build.Evaluation objects.

Project instance targets, host services, and the task registry are not exposed.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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:
© 2014 Microsoft