ElementLocation Class

.NET Framework 4.5

The location of an XML node in a file.

Any editing of the project XML through the MSBuild API's will invalidate locations in that XML until the XML is reloaded.


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

public abstract class ElementLocation

The ElementLocation type exposes the following members.

Protected methodElementLocationInitializes a new instance of the ElementLocation class.

Public propertyColumnThe column number where this element exists in its file. The first column is numbered 1. Zero indicates "unknown location".
Public propertyFileThe file from which this particular element originated. It may differ from the ProjectFile if, for instance, it was part of an import or originated in a targets file. If not known, returns empty string.
Public propertyLineThe line number where this element exists in its file. The first line is numbered 1. Zero indicates "unknown location".
Public propertyLocationStringThe location in a form suitable for replacement into a message. Example: "c:\dir\proj.csproj (12,34)" Calling this creates and formats a new string. Only in rare cases should the location go within the message itself.

Public methodEqualsOverride Equals so that identical fields imply equal objects. (Overrides Object.Equals(Object).)
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 methodGetHashCodeGet reasonable hash code. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringLocation of element. (Overrides Object.ToString().)

This object is IMMUTABLE, so that it can be passed around arbitrarily.

DO NOT make these objects any larger. There are huge numbers of them and they are transmitted between nodes.

.NET Framework

Supported in: 4.5

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.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft