# ElementLocation Class

## Definition

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.

public ref class ElementLocation abstract
[System.Serializable]
public abstract class ElementLocation
[<System.Serializable>]
type ElementLocation = class
Public MustInherit Class ElementLocation
Inheritance
ElementLocation
Attributes

## Remarks

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.

## Constructors

 Initializes a new instance of the ElementLocation class.

## Properties

 The column number where this element exists in its file. The first column is numbered 1. Zero indicates "unknown location". The 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. The line number where this element exists in its file. The first line is numbered 1. Zero indicates "unknown location". The location in a form suitable for replacement into a message. Example: "c:\foo\bar.csproj (12,34)" Calling this creates and formats a new string. PREFER TO PUT THE LOCATION INFORMATION AT THE START OF THE MESSAGE INSTEAD. Only in rare cases should the location go within the message itself.

## Methods

 Override Equals so that identical fields imply equal objects. Get reasonable hash code. Location of element.