Fixed Run method errors due to running new exe in temp directory. Moved to unit test's directory.

pull/83/head
David Hall 2019-07-23 14:26:09 -06:00
parent 277bddcf58
commit b473009b71
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace Vanara.PInvoke.Tests
{
if (mainType.GetMethod("Main", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) is null)
throw new ArgumentException("Supplied type must include a static Main method.");
var exe = Path.ChangeExtension(Path.GetTempFileName(), "exe");
var exe = Path.Combine(Path.GetDirectoryName(mainType.Assembly.Location), "tmp" + Guid.NewGuid().ToString("N") + ".exe");
CompileExe(exe, Decompile(mainType), mainType.GetReferencedAssemblyNames(), mainType.FullName);
return CreateProcess(exe, args, Path.GetDirectoryName(mainType.Assembly.Location));
}