diff --git a/.gitignore b/.gitignore index 3f5cb27518..edc4093242 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ project.lock.json .vscode/ .build/ .testPublish/ +global.json diff --git a/samples/SampleStartups/SampleStartups.csproj b/samples/SampleStartups/SampleStartups.csproj index 4444e3d325..3e29e7642d 100644 --- a/samples/SampleStartups/SampleStartups.csproj +++ b/samples/SampleStartups/SampleStartups.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp2.0 + net46;netcoreapp2.0 diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj b/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj index 2b59d67607..2e1e76227c 100644 --- a/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj @@ -4,7 +4,7 @@ ASP.NET Core hosting and startup abstractions for web applications. - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;hosting diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj b/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj index 580447d146..60cd091d4a 100644 --- a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj @@ -4,7 +4,7 @@ ASP.NET Core hosting server abstractions for web applications. - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;hosting diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj b/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj index 39c9b8ca1a..1623ac665a 100644 --- a/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj +++ b/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj @@ -4,7 +4,7 @@ ASP.NET Core hosting infrastructure and startup logic for web applications running within a Windows service. - net451 + net46 $(NoWarn);CS1591 true aspnetcore;hosting diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs b/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs index 217a30e092..1dbaf8684a 100644 --- a/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs +++ b/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs @@ -207,8 +207,10 @@ namespace Microsoft.AspNetCore.Hosting.Internal var systemRuntimeAssembly = typeof(System.ComponentModel.DefaultValueAttribute).GetTypeInfo().Assembly; var assemblyVersion = new AssemblyName(systemRuntimeAssembly.FullName).Version.ToString(); var clrVersion = assemblyVersion; -#else +#elif NET46 var clrVersion = Environment.Version.ToString(); +#else +#error Target frameworks need to be updated. #endif model.RuntimeArchitecture = RuntimeInformation.ProcessArchitecture.ToString(); var currentAssembly = typeof(ErrorPage).GetTypeInfo().Assembly; diff --git a/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj b/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj index ae8ce723ad..50816ec08f 100644 --- a/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj +++ b/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj @@ -4,7 +4,7 @@ ASP.NET Core hosting infrastructure and startup logic for web applications. - net451;netstandard1.3;netstandard1.5 + netstandard1.3;netstandard1.5 $(NoWarn);CS1591 true aspnetcore;hosting @@ -31,11 +31,8 @@ - - - - + diff --git a/src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs b/src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs index ff2aa31a7d..4fdbbf6025 100644 --- a/src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs +++ b/src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs @@ -37,6 +37,9 @@ namespace Microsoft.AspNetCore.Hosting #if NETSTANDARD1_5 var assemblyLoadContext = AssemblyLoadContext.GetLoadContext(typeof(WebHostExtensions).GetTypeInfo().Assembly); assemblyLoadContext.Unloading += context => shutdown(); +#elif NETSTANDARD1_3 +#else +#error Target frameworks need to be updated. #endif Console.CancelKeyPress += (sender, eventArgs) => { diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs index 34b47d6f9c..c8262eb989 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs @@ -57,8 +57,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting else { if (exception is HttpRequestException -#if NET452 +#if NET46 || exception is System.Net.WebException +#elif NETSTANDARD1_3 +#else +#error Target frameworks need to be updated. #endif ) { diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs index 689b780a9b..56a25424c7 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs @@ -125,13 +125,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, List> environmentVariables) { - var environment = -#if NET452 - startInfo.EnvironmentVariables; -#else - startInfo.Environment; -#endif - + var environment = startInfo.Environment; SetEnvironmentVariable(environment, "ASPNETCORE_ENVIRONMENT", DeploymentParameters.EnvironmentName); foreach (var environmentVariable in environmentVariables) @@ -140,13 +134,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } } -#if NET452 - protected void SetEnvironmentVariable(System.Collections.Specialized.StringDictionary environment, string name, string value) + protected void SetEnvironmentVariable(IDictionary environment, string name, string value) { -#else - protected void SetEnvironmentVariable(System.Collections.Generic.IDictionary environment, string name, string value) - { -#endif if (value == null) { Logger.LogInformation("Removing environment variable {name}", name); diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs index d12b298639..694671b495 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs @@ -33,9 +33,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting { case ServerType.IISExpress: return new IISExpressDeployer(deploymentParameters, logger); -#if NET452 +#if NET46 case ServerType.IIS: return new IISDeployer(deploymentParameters, logger); +#elif NETSTANDARD1_3 +#else +#error Target framework needs to be updated. #endif case ServerType.WebListener: case ServerType.Kestrel: diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISDeployer.cs index 72739c3185..f5cc53bb6d 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISDeployer.cs @@ -1,7 +1,7 @@ // 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. -#if NET452 +#if NET46 using System; using System.Linq; @@ -148,5 +148,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } } } - +#elif NETSTANDARD1_3 +#else +#error Target framework needs to be updated. #endif diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs index 064c3d7cfd..31a7023cfb 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting else { workingDirectory = DeploymentParameters.ApplicationPath; - var targetFramework = DeploymentParameters.TargetFramework ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.1"); + var targetFramework = DeploymentParameters.TargetFramework ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0"); executableName = DotnetCommandName; executableArgs = $"run --framework {targetFramework} {DotnetArgumentSeparator}"; diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj index d605a44d20..51e5864081 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj @@ -5,11 +5,10 @@ ASP.NET Core helpers to deploy applications to IIS Express, IIS, WebListener and Kestrel for testing. 0.3.0 - net452;netstandard1.3 + net46;netstandard1.3 $(NoWarn);CS1591 true aspnetcore;testing - $(PackageTargetFallback);portable-net45+win8 false @@ -22,12 +21,12 @@ - - + + - + diff --git a/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj b/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj index fbd1cde469..24ec0ff0ab 100644 --- a/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj +++ b/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj @@ -4,7 +4,7 @@ ASP.NET Core web server for writing and running tests. - net451;netstandard1.3 + netstandard1.3;net46 $(NoWarn);CS1591 true aspnetcore;hosting;testing diff --git a/src/Microsoft.AspNetCore.TestHost/ResponseStream.cs b/src/Microsoft.AspNetCore.TestHost/ResponseStream.cs index df3a02fcfc..f1c4e5eff3 100644 --- a/src/Microsoft.AspNetCore.TestHost/ResponseStream.cs +++ b/src/Microsoft.AspNetCore.TestHost/ResponseStream.cs @@ -168,20 +168,7 @@ namespace Microsoft.AspNetCore.TestHost _readLock.Release(); } } -#if NET451 - public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) - { - // TODO: This option doesn't preserve the state object. - // return ReadAsync(buffer, offset, count); - return base.BeginRead(buffer, offset, count, callback, state); - } - public override int EndRead(IAsyncResult asyncResult) - { - // return ((Task)asyncResult).Result; - return base.EndRead(asyncResult); - } -#endif public async override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { VerifyBuffer(buffer, offset, count, allowEmpty: false); @@ -266,7 +253,8 @@ namespace Microsoft.AspNetCore.TestHost _writeLock.Release(); } } -#if NET451 + +#if NET46 public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { Write(buffer, offset, count); @@ -283,7 +271,11 @@ namespace Microsoft.AspNetCore.TestHost public override void EndWrite(IAsyncResult asyncResult) { } +#elif NETSTANDARD1_3 +#else +#error Target frameworks need to be updated. #endif + public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { VerifyBuffer(buffer, offset, count, allowEmpty: true); diff --git a/test/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj b/test/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj index 40c0965fdf..bbf764d1ce 100644 --- a/test/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj +++ b/test/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs b/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs index 9af8cad1e2..6f5cd1a6a6 100644 --- a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs +++ b/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal Assert.Equal(expectedEventId, eventData.EventId); #if NETCOREAPP2_0 Assert.Equal("HostStart", eventData.EventName); -#elif NET452 +#elif NET46 #else #error Target framework needs to be updated #endif @@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal Assert.Equal(expectedEventId, eventData.EventId); #if NETCOREAPP2_0 Assert.Equal("HostStop", eventData.EventName); -#elif NET452 +#elif NET46 #else #error Target framework needs to be updated #endif @@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal Assert.Equal(expectedEventId, eventData.EventId); #if NETCOREAPP2_0 Assert.Equal("RequestStart", eventData.EventName); -#elif NET452 +#elif NET46 #else #error Target framework needs to be updated #endif @@ -167,7 +167,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal Assert.Equal(expectedEventId, eventData.EventId); #if NETCOREAPP2_0 Assert.Equal("RequestStop", eventData.EventName); -#elif NET452 +#elif NET46 #else #error Target framework needs to be updated #endif @@ -194,7 +194,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal Assert.Equal(expectedEventId, eventData.EventId); #if NETCOREAPP2_0 Assert.Equal("UnhandledException", eventData.EventName); -#elif NET452 +#elif NET46 #else #error Target framework needs to be updated #endif diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj b/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj index 8928190ced..436e449845 100644 --- a/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj +++ b/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj b/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj index 235ee8e76d..25079b63b1 100644 --- a/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj +++ b/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0