Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 48ca10c

Browse files
committed
Merge branch 'rel/1.1.0' into dev
2 parents 21f7c89 + f8fbb15 commit 48ca10c

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
using System.Diagnostics;
66
using System.IO;
77
using System.Threading;
8-
using Microsoft.Extensions.Logging;
98
using Microsoft.AspNetCore.Server.IntegrationTesting.Common;
9+
using Microsoft.Extensions.Internal;
10+
using Microsoft.Extensions.Logging;
1011

1112
namespace Microsoft.AspNetCore.Server.IntegrationTesting
1213
{
@@ -22,6 +23,16 @@ public IISExpressDeployer(DeploymentParameters deploymentParameters, ILogger log
2223
{
2324
}
2425

26+
public bool IsWin8OrLater
27+
{
28+
get
29+
{
30+
var win8Version = new Version(6, 2);
31+
32+
return (new Version(RuntimeEnvironment.OperatingSystemVersion) >= win8Version);
33+
}
34+
}
35+
2536
public override DeploymentResult Deploy()
2637
{
2738
// Start timer
@@ -57,6 +68,34 @@ private CancellationToken StartIISExpress(Uri uri, string contentRoot)
5768
// Pass on the applicationhost.config to iis express. With this don't need to pass in the /path /port switches as they are in the applicationHost.config
5869
// We take a copy of the original specified applicationHost.Config to prevent modifying the one in the repo.
5970

71+
if (DeploymentParameters.ServerConfigTemplateContent.Contains("[ANCMPath]"))
72+
{
73+
string ancmPath;
74+
if (!IsWin8OrLater)
75+
{
76+
// The nupkg build of ANCM does not support Win7. https://github.com/aspnet/AspNetCoreModule/issues/40.
77+
ancmPath = @"%ProgramFiles%\IIS Express\aspnetcore.dll";
78+
}
79+
// Bin deployed by Microsoft.AspNetCore.AspNetCoreModule.nupkg
80+
else if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.CoreClr
81+
&& DeploymentParameters.ApplicationType == ApplicationType.Portable)
82+
{
83+
ancmPath = Path.Combine(contentRoot, @"runtimes\win7-x64\native\aspnetcore.dll");
84+
}
85+
else
86+
{
87+
ancmPath = Path.Combine(contentRoot, "aspnetcore.dll");
88+
}
89+
90+
if (!File.Exists(ancmPath))
91+
{
92+
throw new FileNotFoundException("AspNetCoreModule could not be found.", ancmPath);
93+
}
94+
95+
DeploymentParameters.ServerConfigTemplateContent =
96+
DeploymentParameters.ServerConfigTemplateContent.Replace("[ANCMPath]", ancmPath);
97+
}
98+
6099
DeploymentParameters.ServerConfigTemplateContent =
61100
DeploymentParameters.ServerConfigTemplateContent
62101
.Replace("[ApplicationPhysicalPath]", contentRoot)

src/Microsoft.AspNetCore.Server.IntegrationTesting/project.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@
2828
"Microsoft.AspNetCore.Testing": "1.2.0-*",
2929
"Microsoft.Extensions.FileProviders.Embedded": "1.2.0-*",
3030
"Microsoft.Extensions.Logging.Abstractions": "1.2.0-*",
31+
"Microsoft.Extensions.PlatformAbstractions": "1.2.0-*",
3132
"Microsoft.Extensions.Process.Sources": {
3233
"type": "build",
3334
"version": "1.2.0-*"
3435
},
35-
"Microsoft.Extensions.PlatformAbstractions": "1.2.0-*",
36+
"Microsoft.Extensions.RuntimeEnvironment.Sources": {
37+
"type": "build",
38+
"version": "1.2.0-*"
39+
},
3640
"NETStandard.Library": "1.6.1-*"
3741
},
3842
"frameworks": {

0 commit comments

Comments
 (0)