From e874f997911250690e7081903fde5f7820ea5839 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 20 Apr 2016 10:52:01 -0700 Subject: [PATCH] Updating deployers for apps using shared runtime --- .../Common/ApplicationType.cs | 11 +++++++++++ .../Common/DeploymentParameters.cs | 2 ++ .../Deployers/SelfHostDeployer.cs | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.AspNetCore.Server.Testing/Common/ApplicationType.cs diff --git a/src/Microsoft.AspNetCore.Server.Testing/Common/ApplicationType.cs b/src/Microsoft.AspNetCore.Server.Testing/Common/ApplicationType.cs new file mode 100644 index 0000000000..a6b7e7942c --- /dev/null +++ b/src/Microsoft.AspNetCore.Server.Testing/Common/ApplicationType.cs @@ -0,0 +1,11 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Server.Testing +{ + public enum ApplicationType + { + Portable, + Standalone + } +} diff --git a/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs index 9150e71f73..3f9af859a8 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs @@ -74,6 +74,8 @@ namespace Microsoft.AspNetCore.Server.Testing /// public bool PublishApplicationBeforeDeployment { get; set; } + public ApplicationType ApplicationType { get; set; } + public string PublishTargetFramework { get; set; } public string PublishedApplicationRootPath { get; set; } diff --git a/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs index 8a43604e3a..210a61cf83 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Deployers/SelfHostDeployer.cs @@ -52,7 +52,9 @@ namespace Microsoft.AspNetCore.Server.Testing string executableArgs = string.Empty; if (DeploymentParameters.PublishApplicationBeforeDeployment) { - var executableExtension = DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" : ""; + var executableExtension = + DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" : + DeploymentParameters.ApplicationType == ApplicationType.Portable ? ".dll" : ""; var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension); if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && PlatformServices.Default.Runtime.OperatingSystemPlatform != Platform.Windows) @@ -60,6 +62,11 @@ namespace Microsoft.AspNetCore.Server.Testing executableName = "mono"; executableArgs = executable; } + else if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.CoreClr && DeploymentParameters.ApplicationType == ApplicationType.Portable) + { + executableName = "dotnet"; + executableArgs = executable; + } else { executableName = executable;