From 539a13717e3d479e97a75e45e6f52c5959eadb83 Mon Sep 17 00:00:00 2001 From: "Chris Ross (ASP.NET)" Date: Fri, 5 May 2017 10:41:09 -0700 Subject: [PATCH] Migrate to netcoreapp2.0 --- build/dependencies.props | 2 +- samples/IISSample/IISSample.csproj | 4 +- ...ft.AspNetCore.Server.IISIntegration.csproj | 6 +- .../HelloWorldTest.cs | 42 +++-------- .../HttpsTest.cs | 72 ++++++------------- .../IISIntegration.FunctionalTests.csproj | 4 +- .../NtlmAuthentationTest.cs | 30 +++----- ...NetCore.Server.IISIntegration.Tests.csproj | 5 +- test/TestSites/TestSites.csproj | 3 +- 9 files changed, 47 insertions(+), 121 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 165a39127a..fcc3e15e8b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,4 +1,4 @@ - + 2.0.0-preview1-* 0.3.0-* diff --git a/samples/IISSample/IISSample.csproj b/samples/IISSample/IISSample.csproj index 5d80070c40..71d9254080 100644 --- a/samples/IISSample/IISSample.csproj +++ b/samples/IISSample/IISSample.csproj @@ -1,9 +1,9 @@ - + - netcoreapp2.0;net46 + netcoreapp2.0 diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj b/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj index e38b9bf8d7..77091fee0e 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj @@ -4,7 +4,7 @@ ASP.NET Core components for working with the IIS AspNetCoreModule. - netstandard1.3 + netcoreapp2.0 $(NoWarn);CS1591 true aspnetcore;iis @@ -17,8 +17,8 @@ - - + + diff --git a/test/IISIntegration.FunctionalTests/HelloWorldTest.cs b/test/IISIntegration.FunctionalTests/HelloWorldTest.cs index d8799fae7e..e77100521c 100644 --- a/test/IISIntegration.FunctionalTests/HelloWorldTest.cs +++ b/test/IISIntegration.FunctionalTests/HelloWorldTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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. using System; @@ -22,50 +22,26 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - //[InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x86, ApplicationType.Portable)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task HelloWorld_IISExpress(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + //[InlineData(RuntimeArchitecture.x86, ApplicationType.Portable)] + [InlineData(RuntimeArchitecture.x64, ApplicationType.Portable)] + public Task HelloWorld_IISExpress(RuntimeArchitecture architecture, ApplicationType applicationType) { - return HelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); + return HelloWorld(ServerType.IISExpress, architecture, applicationType); } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CLR)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Portable)] - // TODO reenable when https://github.com/dotnet/sdk/issues/696 is resolved - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)] - [InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task HelloWorld_IISExpress_CoreClr(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + public async Task HelloWorld(ServerType serverType, RuntimeArchitecture architecture, ApplicationType applicationType) { - return HelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); - } - - [ConditionalTheory] - [SkipIfEnvironmentVariableNotEnabled("IIS_VARIATIONS_ENABLED")] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Standalone)] - public Task HelloWorld_IIS(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) - { - return HelloWorld(ServerType.IIS, runtimeFlavor, architecture, applicationType); - } - - public async Task HelloWorld(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) - { - var testName = $"HelloWorld_{serverType}_{runtimeFlavor}_{architecture}"; + var testName = $"HelloWorld_{serverType}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) { EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld', ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null, SiteName = "HttpTestSite", // This is configured in the Http.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0", + TargetFramework = "netcoreapp2.0", ApplicationType = applicationType }; diff --git a/test/IISIntegration.FunctionalTests/HttpsTest.cs b/test/IISIntegration.FunctionalTests/HttpsTest.cs index a5fb8edbdb..f20246851f 100644 --- a/test/IISIntegration.FunctionalTests/HttpsTest.cs +++ b/test/IISIntegration.FunctionalTests/HttpsTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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. using System; @@ -25,40 +25,29 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44396/", ApplicationType.Portable)] - public Task Https_HelloWorld(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) - { - return HttpsHelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType); - } - [ConditionalTheory(Skip = "No test configuration enabled")] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CLR)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "https://localhost:44394/", ApplicationType.Portable)] - // TODO reenable when https://github.com/dotnet/sdk/issues/696 is resolved - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "https://localhost:44395/", ApplicationType.Standalone)] - public Task Https_HelloWorld_CoreCLR(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + //[InlineData(RuntimeArchitecture.x86, "https://localhost:44394/", ApplicationType.Portable)] + [InlineData(RuntimeArchitecture.x64, "https://localhost:44395/", ApplicationType.Standalone)] + public Task Https_HelloWorld(RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { - return HttpsHelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType); + return HttpsHelloWorld(ServerType.IISExpress, architecture, applicationBaseUrl, applicationType); } - public async Task HttpsHelloWorld(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + public async Task HttpsHelloWorld(ServerType serverType, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { - var testName = $"HttpsHelloWorld_{serverType}_{runtimeFlavor}_{architecture}"; + var testName = $"HttpsHelloWorld_{serverType}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HttpsHelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) { ApplicationBaseUriHint = applicationBaseUrl, EnvironmentName = "HttpsHelloWorld", // Will pick the Start class named 'StartupHttpsHelloWorld', ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null, SiteName = "HttpsTestSite", // This is configured in the Https.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0", + TargetFramework = "netcoreapp2.0", ApplicationType = applicationType }; @@ -91,58 +80,37 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests } } - [ConditionalTheory(Skip = "No test configuration enabled")] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - //[InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x86, "https://localhost:44399/", ApplicationType.Standalone)] - public Task Https_HelloWorld_NoClientCert(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) - { - return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: false); - } - [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CLR)] - // TODO reenable when https://github.com/dotnet/sdk/issues/696 is resolved - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "https://localhost:44397/", ApplicationType.Standalone)] - [InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "https://localhost:44398/", ApplicationType.Portable)] - public Task Https_HelloWorld_NoClientCert_CoreCLR(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + //[InlineData(RuntimeArchitecture.x86, "https://localhost:44399/", ApplicationType.Standalone)] + [InlineData(RuntimeArchitecture.x64, "https://localhost:44398/", ApplicationType.Portable)] + public Task Https_HelloWorld_NoClientCert(RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { - return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: false); + return HttpsHelloWorldCerts(ServerType.IISExpress, architecture, applicationBaseUrl, applicationType, sendClientCert: false); } [ConditionalTheory(Skip = "Manual test only, selecting a client cert is non-determanistic on different machines.")] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44301/", ApplicationType.Portable)] - public Task Https_HelloWorld_ClientCert(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + [InlineData(RuntimeArchitecture.x64, "https://localhost:44301/", ApplicationType.Portable)] + public Task Https_HelloWorld_ClientCert(RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { - return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: true); + return HttpsHelloWorldCerts(ServerType.IISExpress, architecture, applicationBaseUrl, applicationType, sendClientCert: true); } - [ConditionalTheory(Skip = "Manual test only, selecting a client cert is non-determanistic on different machines.")] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CLR)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "https://localhost:44302/", ApplicationType.Standalone)] - public Task Https_HelloWorld_ClientCert_CoreCLR(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + public async Task HttpsHelloWorldCerts(ServerType serverType, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType, bool sendClientCert) { - return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: true); - } - - public async Task HttpsHelloWorldCerts(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType, bool sendClientCert) - { - var testName = $"HttpsHelloWorldCerts_{serverType}_{runtimeFlavor}_{architecture}"; + var testName = $"HttpsHelloWorldCerts_{serverType}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HttpsHelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) { ApplicationBaseUriHint = applicationBaseUrl, EnvironmentName = "HttpsHelloWorld", // Will pick the Start class named 'StartupHttpsHelloWorld', ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null, SiteName = "HttpsTestSite", // This is configured in the Https.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0", + TargetFramework = "netcoreapp2.0", ApplicationType = applicationType }; diff --git a/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj b/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj index c32d9ba2f5..457d60fdd1 100644 --- a/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj +++ b/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj @@ -3,9 +3,7 @@ - net46;netcoreapp2.0 - true - true + netcoreapp2.0 diff --git a/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs b/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs index 80dc98a092..dfce24a5eb 100644 --- a/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs +++ b/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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. using System; @@ -24,27 +24,15 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task NtlmAuthentication(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + [InlineData(RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/82")] + public Task NtlmAuthentication(RuntimeArchitecture architecture, ApplicationType applicationType) { - return NtlmAuthentication(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); + return NtlmAuthentication(ServerType.IISExpress, architecture, applicationType); } - [ConditionalTheory(Skip = "No test configuration enabled")] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [FrameworkSkipCondition(RuntimeFrameworks.CLR)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Standalone)] - // TODO reenable when https://github.com/dotnet/sdk/issues/696 is resolved - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)] - public Task NtlmAuthentication_CoreCLR(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + public async Task NtlmAuthentication(ServerType serverType, RuntimeArchitecture architecture, ApplicationType applicationType) { - return NtlmAuthentication(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); - } - - public async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) - { - var testName = $"NtlmAuthentication_{serverType}_{runtimeFlavor}_{architecture}"; + var testName = $"NtlmAuthentication_{serverType}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("NtlmAuthenticationTest"); @@ -53,14 +41,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests ? "win7-x64" : "win7-x86"; - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) { EnvironmentName = "NtlmAuthentication", // Will pick the Start class named 'StartupNtlmAuthentication' ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("NtlmAuthentation.config") : null, SiteName = "NtlmAuthenticationTestSite", // This is configured in the NtlmAuthentication.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0", + TargetFramework = "netcoreapp2.0", ApplicationType = applicationType, - AdditionalPublishParameters = ApplicationType.Standalone == applicationType && RuntimeFlavor.CoreClr == runtimeFlavor + AdditionalPublishParameters = ApplicationType.Standalone == applicationType ? "-r " + windowsRid : null }; diff --git a/test/Microsoft.AspNetCore.Server.IISIntegration.Tests/Microsoft.AspNetCore.Server.IISIntegration.Tests.csproj b/test/Microsoft.AspNetCore.Server.IISIntegration.Tests/Microsoft.AspNetCore.Server.IISIntegration.Tests.csproj index 7bc92ba003..ce16269ed5 100644 --- a/test/Microsoft.AspNetCore.Server.IISIntegration.Tests/Microsoft.AspNetCore.Server.IISIntegration.Tests.csproj +++ b/test/Microsoft.AspNetCore.Server.IISIntegration.Tests/Microsoft.AspNetCore.Server.IISIntegration.Tests.csproj @@ -3,10 +3,7 @@ - netcoreapp2.0;net46 - netcoreapp2.0 - true - true + netcoreapp2.0 diff --git a/test/TestSites/TestSites.csproj b/test/TestSites/TestSites.csproj index d203449431..ee2f0b2155 100644 --- a/test/TestSites/TestSites.csproj +++ b/test/TestSites/TestSites.csproj @@ -3,8 +3,7 @@ - netcoreapp2.0;net46 - netcoreapp2.0 + netcoreapp2.0