Move the temp folder under the project root

- Makes it easier to find it
- Works for .NET Framework when changing the app base
- There seems to be a problem when quitting the child process with Ctrl + C
This commit is contained in:
David Fowler 2015-12-13 22:07:32 -08:00
parent 91acc03a13
commit 2f64f62e67

View file

@ -85,8 +85,9 @@ namespace Microsoft.DotNet.Tools.Run
{
CalculateDefaultsForNonAssigned();
// Create a temporary directory
var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
// Create a temporary directory under the project root
// REVIEW: MAX_PATH?
var tempDir = Path.Combine(_context.ProjectDirectory, "bin", ".dotnetrun", Guid.NewGuid().ToString("N"));
// Compile to that directory
var result = Command.Create($"dotnet-compile", $"--output \"{tempDir}\" --temp-output \"{tempDir}\" --framework \"{_context.TargetFramework}\" --configuration \"{Configuration}\" {_context.ProjectFile.ProjectDirectory}")
@ -136,7 +137,7 @@ namespace Microsoft.DotNet.Tools.Run
.ForwardStdErr()
.EnvironmentVariable("DOTNET_HOME", runtime)
.Execute();
// Clean up
if (!PreserveTemporary)
{