From 947adbc8a89c15c66bcdfa6cf98be623b58d13bd Mon Sep 17 00:00:00 2001 From: = Date: Tue, 1 Mar 2016 15:10:27 -0800 Subject: [PATCH] Fix deployers for non-windows platforms and coreclr - Execute published clr applications on linux and mac with mono - Update TFM for coreclr project to netstandardapp1.5 --- .../Deployers/ApplicationDeployer.cs | 2 +- .../Deployers/SelfHostDeployer.cs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs index 26ba4de34c..e5d63a6caa 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Server.Testing protected void PickRuntime() { - TargetFrameworkName = DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "dnxcore50"; + TargetFrameworkName = DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5"; Logger.LogInformation($"Pick target framework {TargetFrameworkName}"); } diff --git a/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs index 3016cb72c1..1bac2ef81b 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs @@ -5,8 +5,9 @@ using System; using System.Diagnostics; using System.IO; using System.Threading; -using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Server.Testing.Common; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.AspNetCore.Server.Testing { @@ -54,7 +55,17 @@ namespace Microsoft.AspNetCore.Server.Testing if (DeploymentParameters.PublishApplicationBeforeDeployment) { var executableExtension = DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" : ""; - executableName = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension); + var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension); + + if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && PlatformServices.Default.Runtime.OperatingSystemPlatform != Platform.Windows) + { + executableName = "mono"; + executableArgs = executable; + } + else + { + executableName = executable; + } } else {