Never trust Environment.CurrentDirectory
If your code relies on “Environment.CurrentDirectory” to get the directory your application is “running in” you can get really surprising behaviors.
Environment.CurrentDirectory can be changed at any time by any piece of code, even by code not directly under your control, it is much better to build your own logic to get the “startup” directory, such as:
public static class FileSystem
{
public static String GetCurrentDirectory()
{
return Path.GetDirectoryName( Assembly.GetEntryAssembly().Location );
}
}
.m