The executeProcess function is called with the workingDir parameter = "".
Somehow the working directory is defaulting to C:\Windows\System32 when the workingDir parameter = "", which causes an exception from the lines below.
#if DEBUG
File.WriteAllLines(Path.Combine(workingDir, "StandardOutput.txt"), outputList)
File.WriteAllLines(Path.Combine(workingDir, "StandardError.txt"), errorsList)
#endif
An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code
Access to the path 'C:\Windows\System32\StandardOutput.txt' is denied.
Some other tests are also affected.
We need to default the working directory to the assembly location. Maybe like this:
#if DEBUG
let workingDir' =
if workingDir = ""
then
let executionLocation = Assembly.GetExecutingAssembly().Location
Path.GetDirectoryName executionLocation
else
workingDir
File.WriteAllLines(Path.Combine(workingDir', "StandardOutput.txt"), outputList)
File.WriteAllLines(Path.Combine(workingDir', "StandardError.txt"), errorsList)
#endif
The
executeProcessfunction is called with theworkingDirparameter = "".Somehow the working directory is defaulting to C:\Windows\System32 when the
workingDirparameter = "", which causes an exception from the lines below.An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code
Access to the path 'C:\Windows\System32\StandardOutput.txt' is denied.
Some other tests are also affected.
We need to default the working directory to the assembly location. Maybe like this: