When executing a C# script (.csx
) with C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\csi.exe
, how do I get the path to the script being executed?
The line
Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
prints the path to the interpreter (csi.exe
), not the script.
The script should be aware of it's path at some level, as you can load assemblies with a relative path like this:
#r "..\\bla\\asdf.dll"