strange error. One of which i cannot find any existing resources to solve the issue.
The issue is, when using Application.StartupPath I get pointed to a folder at “C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0”. Naturally, this breaks everything which depends on the correct folder (the one my solution is actually in) being given.
What is more strange is that there exists a unit-test to make sure that this path at least has the correct root folder and sometimes it will pass and Application.StartupPath will be working as expected, and then the very next debug, will point to the aforementioned folder again. Very confusing and very annoying !
Any ideas ?
It seems like you have web application and this is why it spins up the web server which is the actual application which reports StartupPath. Your unit tests probably run as a console application or something similar which results in a different StartupPath. For web applications you’d better use Server.MapPath to deal with file system paths.