Of the following methods, to get the working directory of the executing assembly, is there a recommendation that is considered best practice? I heard from my developers that method 1 does not work on Windows 7 SP1 64-bit sometimes, unless it runs with elevated permissions ( Run as administrator ). But method 2 works all the time. Is there a reason why the first of them sometimes fail?
Method 1:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())
Method 2:
Environment.CurrentDirectory
user1129208
source
share