diff --git a/src/Microsoft.DotNet.ProjectModel/OutputPathCalculator.cs b/src/Microsoft.DotNet.ProjectModel/OutputPathCalculator.cs index b57ede72f..037ec87a5 100644 --- a/src/Microsoft.DotNet.ProjectModel/OutputPathCalculator.cs +++ b/src/Microsoft.DotNet.ProjectModel/OutputPathCalculator.cs @@ -133,7 +133,7 @@ namespace Microsoft.DotNet.ProjectModel // This is the check for mono, if we're not on windows and producing outputs for // the desktop framework then it's an exe - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && _framework.IsDesktop()) + if (_framework.IsDesktop()) { extension = FileNameSuffixes.DotNet.Exe; } diff --git a/src/dotnet/commands/dotnet-run/Program.cs b/src/dotnet/commands/dotnet-run/Program.cs index 390943002..fe5ab79c7 100644 --- a/src/dotnet/commands/dotnet-run/Program.cs +++ b/src/dotnet/commands/dotnet-run/Program.cs @@ -28,7 +28,6 @@ namespace Microsoft.DotNet.Tools.Run syntax.DefineOption("f|framework", ref runCmd.Framework, "Compile a specific framework"); syntax.DefineOption("c|configuration", ref runCmd.Configuration, "Configuration under which to build"); - syntax.DefineOption("t|preserve-temporary", ref runCmd.PreserveTemporary, "Keep the output's temporary directory around"); syntax.DefineOption("p|project", ref runCmd.Project, "The path to the project to run (defaults to the current directory). Can be a path to a project.json or a project directory"); syntax.DefineOption("h|help", ref help, "Help for compile native."); diff --git a/src/dotnet/commands/dotnet-run/RunCommand.cs b/src/dotnet/commands/dotnet-run/RunCommand.cs index 23987bdba..d94745e47 100644 --- a/src/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/dotnet/commands/dotnet-run/RunCommand.cs @@ -16,7 +16,6 @@ namespace Microsoft.DotNet.Tools.Run { public string Framework = null; public string Configuration = null; - public bool PreserveTemporary = false; public string Project = null; public IReadOnlyList Args = null; @@ -85,23 +84,15 @@ namespace Microsoft.DotNet.Tools.Run { CalculateDefaultsForNonAssigned(); - // 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 = Build.BuildCommand.Run(new[] - { - $"--output", - $"{tempDir}", - $"--temp-output", - $"{tempDir}", - $"--framework", - $"{_context.TargetFramework}", - $"--configuration", - $"{Configuration}", - $"{_context.ProjectFile.ProjectDirectory}" - }); + { + $"--framework", + $"{_context.TargetFramework}", + $"--configuration", + $"{Configuration}", + $"{_context.ProjectFile.ProjectDirectory}" + }); if (result != 0) { @@ -109,7 +100,7 @@ namespace Microsoft.DotNet.Tools.Run } // Now launch the output and give it the results - var outputName = _context.GetOutputPathCalculator(tempDir).GetExecutablePath(Configuration); + var outputName = _context.GetOutputPathCalculator().GetExecutablePath(Configuration); if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -149,12 +140,6 @@ namespace Microsoft.DotNet.Tools.Run .Execute() .ExitCode; - // Clean up - if (!PreserveTemporary) - { - Directory.Delete(tempDir, recursive: true); - } - return result; }