Browse Source

avoid exceptions in PrepareRemoteExecutor()

pull/1089/head
Anton Firszov 6 years ago
parent
commit
3e33bb3bb8
  1. 31
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

31
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

@ -165,26 +165,27 @@ namespace SixLabors.ImageSharp.Tests
return;
}
string windowsSdksDir = Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES(x86)"),
"Microsoft SDKs", "Windows");
// Locate and run CorFlags.exe:
try
{
string windowsSdksDir = Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES(x86)"),
"Microsoft SDKs", "Windows");
FileInfo corFlagsFile = Find(new DirectoryInfo(windowsSdksDir), "corflags.exe");
FileInfo corFlagsFile = Find(new DirectoryInfo(windowsSdksDir), "corflags.exe");
string remoteExecutorPath = Path.Combine(assemblyFile.DirectoryName, "Microsoft.DotNet.RemoteExecutor.exe");
string remoteExecutorPath = Path.Combine(assemblyFile.DirectoryName, "Microsoft.DotNet.RemoteExecutor.exe");
string args = $"{remoteExecutorPath} /32Bit+ /Force";
string args = $"{remoteExecutorPath} /32Bit+ /Force";
var si = new ProcessStartInfo()
{
FileName = corFlagsFile.FullName,
Arguments = args,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
var si = new ProcessStartInfo()
{
FileName = corFlagsFile.FullName,
Arguments = args,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
try
{
using var proc = Process.Start(si);
proc.WaitForExit();
string standardOutput = proc.StandardOutput.ReadToEnd();

Loading…
Cancel
Save