Just as a note to my self, here I showed one way of getting exe path, another way can be something like this:

Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Afile.xml")

So, with line:

Assembly.GetExecutingAssembly().Location

we are receiving full path, then with line:

Path.GetDirectoryName(...)

we are getting just a folder name, and with line:

Path.Combine(...)

we are combining path with our file name.

I was playing little bit with classes. Idea is to see how it will behave if we declare method with type as current class instance to which this method belong.

So, I have declared class like:

public class MyClass
{
	public string mOne = "none";
	public string mTwo = "none";
	public string mAll = "none";

	public MyClass MyMethodOne()
	{
		this.mOne = "I am from method one";
		this.mAll = "My name is all and I am also from method one";
		return this;
	}

	public MyClass MyMethodTwo()
	{
		this.mTwo = "I am from method two";
		this.mAll = "My name is all and I am also from method two";

		return this;
	}

	public MyClass MyMethodNewInstanceOne()
	{
		MyClass something = new MyClass();

		something.mOne = "I am from method one";
		something.mAll = "My name is all and I am also from method one";
		return this;
	}

	public MyClass MyMethodNewInstanceTwo()
	{
		MyClass something = new MyClass();

		something.mTwo = "I am from method two";
		something.mAll = "My name is all and I am also from method two";

		return something;
	}

}

Notice for example:

this.mTwo = "I am from method two";
return this;

Here we are not creating new instance, so if we do call like:

MyClass myClassesResult = playingWithClasses.MyMethodOne().MyMethodTwo();

We will not loose any changes

That means that if we create console application like:

MyClass playingWithClasses = new MyClass();
MyClass myClassesResult = playingWithClasses.MyMethodOne().MyMethodTwo();
Console.WriteLine("************* without new instance *************");

Console.WriteLine("One: " + myClassesResult.mOne);
Console.WriteLine("Two: " + myClassesResult.mTwo);
Console.WriteLine("All: " + myClassesResult.mAll);

Result will be like:

************* without new instance *************
One: I am from method one
Two: I am from method two
All: My name is all and I am also from method two

Then notice for example:

MyClass something = new MyClass();
something.mTwo = "I am from method two";
return something;

That means that if we create console application like:

MyClass playingWithClasses = new MyClass();
MyClass myClassesNewInstanceResult = playingWithClasses.MyMethodNewInstanceOne().MyMethodNewInstanceTwo();

Console.WriteLine("************* with new instance *************");

Console.WriteLine("One: " + myClassesNewInstanceResult.mOne);
Console.WriteLine("Two: " + myClassesNewInstanceResult.mTwo);
Console.WriteLine("All: " + myClassesNewInstanceResult.mAll);

Result will be like:

************* with new instance *************
One: none
Two: I am from method two
All: My name is all and I am also from method two

Example project you can download from here.

Here I explained how changing one XML in class library can lead to hell. It seems that another solution would be to add XML as a link. 

To add XML as a link right click on the project, click add Existing item:

Choose XML and choose add as link from drop down menu:

And that should be it...

Copy if newer doesn't work as I (or probably anyone else) would expect.

For example create new WPF project (CopyIfNewerHell):

Then, in solution add new Class Library:

Now, create an XML, like:

<?xml version="1.0" encoding="UTF-8"?>
<rootNode>
	<childNode>
	  Child
	</childNode>
</rootNode>

Include that XML in the class library. On the end your solution should like something like:

Set properties of your XML:

Build action = Content, Copy to Output Directory = Copy if newer:

After that, add class library to CopyIfNewerHell project, so your references shoud look like:

Now you can hit F5. If you check bin folder, in my case it is here:

\Documents\Visual Studio 2012\Projects\CopyIfNewerHell\CopyIfNewerHell\bin\Debug\CopyIfNewerHell.xml

You will see CopyIfNewerHell.xml file. Open it in, for example, Notepad, and you will see:

<?xml version="1.0" encoding="UTF-8"?>
<rootNode>
	<childNode>
	  Child
	</childNode>
</rootNode>

Now in Visual studio, open your xml, and change it, like:

<?xml version="1.0" encoding="UTF-8"?>
<rootNode>
	<childNode>
	  ChildNode
	</childNode>
</rootNode>

Hit F5, and again if you open \Documents\Visual Studio 2012\Projects\CopyIfNewerHell\CopyIfNewerHell\bin\Debug\CopyIfNewerHell.xml in notepad, you will see that file was not changed. File CopyIfNewerHell.xml will be changed only if you change any property of that file. Also, if you change property Build action instead of Content to Embedded Resource then XML will be copied everytime when you change content of your file...

Solution I've found here

---

Here I explained another possible solution.