Hi all,
Currently I have a test class called TestClass.cs in C:\Projects\TestProject\TestClass.cs
I also have an Xml file in C:\Projects\TestProject\config\config.xml
In TestClass.cs, I have a test method to load the Xml from the filesystem like so:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Path.Combine(Assembly.GetExecutingAssembly().Location, "config\config.xml"));
Unfortunately, the Location property gives me the value:
C:\Projects\TestProject\TestResults\klaw_[computernamehere] [time here]\
instead of what I want, which is C:\Projects\TestProject\
I've tried Assembly.GetExecutingAssembly().CodeBase as well with similar results.
Any ideas?