diff --git a/.gitignore b/.gitignore index 25ea28a4e6..79ab4fd067 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ project.lock.json *.*sdf *.ipch *.vs/ +.vscode/ .testPublish/ .build/ *.nuget.props diff --git a/build/common.props b/build/common.props index 1633087c58..eefc14e32c 100644 --- a/build/common.props +++ b/build/common.props @@ -16,8 +16,8 @@ - - + + diff --git a/build/dependencies.props b/build/dependencies.props index 6d70bcbc72..67ec9bf6fa 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,9 +3,9 @@ 2.0.0-* 0.4.0-* 1.0.0-* - 4.3.0 + 4.4.0-* 2.1.0-* - $(BundledNETStandardPackageVersion) + 2.0.0-* 15.3.0-* 2.3.0-beta2-* diff --git a/samples/IISSample/IISSample.csproj b/samples/IISSample/IISSample.csproj index 71d9254080..b03636ae0e 100644 --- a/samples/IISSample/IISSample.csproj +++ b/samples/IISSample/IISSample.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0 + netcoreapp2.0;net461 @@ -15,4 +15,7 @@ + + + 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 770455059e..b9bce3b967 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. - netcoreapp2.0 + netstandard2.0 $(NoWarn);CS1591 true aspnetcore;iis diff --git a/test/IISIntegration.FunctionalTests/HelloWorldTest.cs b/test/IISIntegration.FunctionalTests/HelloWorldTest.cs index 6dadb9bae7..0dd43ef904 100644 --- a/test/IISIntegration.FunctionalTests/HelloWorldTest.cs +++ b/test/IISIntegration.FunctionalTests/HelloWorldTest.cs @@ -22,26 +22,39 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - //[InlineData(RuntimeArchitecture.x86, ApplicationType.Portable)] - [InlineData(RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task HelloWorld_IISExpress(RuntimeArchitecture architecture, ApplicationType applicationType) + [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) { - return HelloWorld(ServerType.IISExpress, architecture, applicationType); + return HelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); } - private async Task HelloWorld(ServerType serverType, RuntimeArchitecture architecture, ApplicationType applicationType) + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [FrameworkSkipCondition(RuntimeFrameworks.CLR)] + //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Portable)] + // TODO reenable when https://github.com/aspnet/IISIntegration/issues/373 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) { - var testName = $"HelloWorld_{serverType}_{architecture}"; + return HelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); + } + + private async Task HelloWorld(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + { + var testName = $"HelloWorld_{serverType}_{runtimeFlavor}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, 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 = "netcoreapp2.0", + TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", ApplicationType = applicationType }; diff --git a/test/IISIntegration.FunctionalTests/HttpsTest.cs b/test/IISIntegration.FunctionalTests/HttpsTest.cs index 97864ac0b1..22d19aba8d 100644 --- a/test/IISIntegration.FunctionalTests/HttpsTest.cs +++ b/test/IISIntegration.FunctionalTests/HttpsTest.cs @@ -25,29 +25,40 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { } - [ConditionalTheory(Skip = "No test configuration enabled")] + [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - //[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) + [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, architecture, applicationBaseUrl, applicationType); + return HttpsHelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType); } - private async Task HttpsHelloWorld(ServerType serverType, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType 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/aspnet/IISIntegration/issues/373 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) { - var testName = $"HttpsHelloWorld_{serverType}_{architecture}"; + return HttpsHelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType); + } + + private async Task HttpsHelloWorld(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + { + var testName = $"HttpsHelloWorld_{serverType}_{runtimeFlavor}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HttpsHelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, 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 = "netcoreapp2.0", + TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", ApplicationType = applicationType }; @@ -80,37 +91,58 @@ 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)] - //[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) + [FrameworkSkipCondition(RuntimeFrameworks.CLR)] + // TODO reenable when https://github.com/aspnet/IISIntegration/issues/373 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) { - return HttpsHelloWorldCerts(ServerType.IISExpress, architecture, applicationBaseUrl, applicationType, sendClientCert: false); + return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, 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)] - [InlineData(RuntimeArchitecture.x64, "https://localhost:44301/", ApplicationType.Portable)] - public Task Https_HelloWorld_ClientCert(RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) + [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) { - return HttpsHelloWorldCerts(ServerType.IISExpress, architecture, applicationBaseUrl, applicationType, sendClientCert: true); + return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: true); } - private async Task HttpsHelloWorldCerts(ServerType serverType, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType, bool sendClientCert) + [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) { - var testName = $"HttpsHelloWorldCerts_{serverType}_{architecture}"; + return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: true); + } + + private async Task HttpsHelloWorldCerts(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType, bool sendClientCert) + { + var testName = $"HttpsHelloWorldCerts_{serverType}_{runtimeFlavor}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("HttpsHelloWorldTest"); - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, 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 = "netcoreapp2.0", + TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", ApplicationType = applicationType }; diff --git a/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj b/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj index 706883db44..9d3a785ab3 100644 --- a/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj +++ b/test/IISIntegration.FunctionalTests/IISIntegration.FunctionalTests.csproj @@ -3,7 +3,8 @@ - netcoreapp2.0 + netcoreapp2.0 + $(NoWarn);xUnit1003 diff --git a/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs b/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs index 7cf950eeb1..4d314f42cc 100644 --- a/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs +++ b/test/IISIntegration.FunctionalTests/NtlmAuthentationTest.cs @@ -24,15 +24,27 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [InlineData(RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task NtlmAuthentication(RuntimeArchitecture architecture, ApplicationType applicationType) + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] + public Task NtlmAuthentication(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { - return NtlmAuthentication(ServerType.IISExpress, architecture, applicationType); + return NtlmAuthentication(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); } - private async Task NtlmAuthentication(ServerType serverType, RuntimeArchitecture architecture, ApplicationType 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/aspnet/IISIntegration/issues/373 is resolved + //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)] + Task NtlmAuthentication_CoreCLR(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { - var testName = $"NtlmAuthentication_{serverType}_{architecture}"; + return NtlmAuthentication(ServerType.IISExpress, runtimeFlavor, architecture, applicationType); + } + + private async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + { + var testName = $"NtlmAuthentication_{serverType}_{runtimeFlavor}_{architecture}"; using (StartLog(out var loggerFactory, testName)) { var logger = loggerFactory.CreateLogger("NtlmAuthenticationTest"); @@ -41,14 +53,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests ? "win7-x64" : "win7-x86"; - var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, RuntimeFlavor.CoreClr, architecture) + var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, 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 = "netcoreapp2.0", + TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", ApplicationType = applicationType, - AdditionalPublishParameters = ApplicationType.Standalone == applicationType + AdditionalPublishParameters = ApplicationType.Standalone == applicationType && RuntimeFlavor.CoreClr == runtimeFlavor ? "-r " + windowsRid : null }; @@ -76,7 +88,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("Anonymous?True", responseText); - /* Disabled for due to https://github.com/aspnet/ServerTests/issues/82 response = await httpClient.GetAsync("/Restricted"); responseText = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); @@ -93,7 +104,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests response = await httpClient.GetAsync("/Forbidden"); responseText = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode); - */ var httpClientHandler = new HttpClientHandler() { UseDefaultCredentials = true }; httpClient = deploymentResult.CreateHttpClient(httpClientHandler); 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 273a718307..32537f1e0d 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,7 +3,8 @@ - netcoreapp2.0 + netcoreapp2.0;net461 + netcoreapp2.0 diff --git a/test/TestSites/TestSites.csproj b/test/TestSites/TestSites.csproj index ee2f0b2155..b066520e12 100644 --- a/test/TestSites/TestSites.csproj +++ b/test/TestSites/TestSites.csproj @@ -3,7 +3,8 @@ - netcoreapp2.0 + netcoreapp2.0;net461 + netcoreapp2.0