diff --git a/HttpSysServer.sln b/HttpSysServer.sln
index de17b49c97..0663cc30a2 100644
--- a/HttpSysServer.sln
+++ b/HttpSysServer.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26202.1
+VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{99D5E5F3-88F5-4CCF-8D8C-717C8925DF09}"
EndProject
@@ -34,6 +34,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{85914BA9-4168-48C5-9C3F-E2E8B1479A6E}"
ProjectSection(SolutionItems) = preProject
build\common.props = build\common.props
+ build\dependencies.props = build\dependencies.props
build\Key.snk = build\Key.snk
EndProjectSection
EndProject
diff --git a/build/dependencies.props b/build/dependencies.props
index 12a50aa67f..dc20c228e8 100644
--- a/build/dependencies.props
+++ b/build/dependencies.props
@@ -4,6 +4,7 @@
4.3.0
1.6.1
2.0.0-*
+ 4.3.1
15.0.0
2.2.0
diff --git a/samples/HotAddSample/HotAddSample.csproj b/samples/HotAddSample/HotAddSample.csproj
index 10f656a63b..e9223fff1b 100644
--- a/samples/HotAddSample/HotAddSample.csproj
+++ b/samples/HotAddSample/HotAddSample.csproj
@@ -3,16 +3,13 @@
- net451;netcoreapp2.0
+ net46;netcoreapp2.0
Exe
true
-
-
-
diff --git a/samples/SelfHostServer/SelfHostServer.csproj b/samples/SelfHostServer/SelfHostServer.csproj
index 10f656a63b..e9223fff1b 100644
--- a/samples/SelfHostServer/SelfHostServer.csproj
+++ b/samples/SelfHostServer/SelfHostServer.csproj
@@ -3,16 +3,13 @@
- net451;netcoreapp2.0
+ net46;netcoreapp2.0
Exe
true
-
-
-
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Microsoft.AspNetCore.Server.HttpSys.csproj b/src/Microsoft.AspNetCore.Server.HttpSys/Microsoft.AspNetCore.Server.HttpSys.csproj
index e21a352f81..1f01f022d7 100644
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Microsoft.AspNetCore.Server.HttpSys.csproj
+++ b/src/Microsoft.AspNetCore.Server.HttpSys/Microsoft.AspNetCore.Server.HttpSys.csproj
@@ -4,7 +4,7 @@
ASP.NET Core HTTP server that uses the Windows HTTP Server API.
- net451;netstandard1.3
+ net46;netstandard1.3
$(NoWarn);CS1591
true
true
@@ -16,11 +16,11 @@
+
-
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/NativeInterop/AddressFamily.cs b/src/Microsoft.AspNetCore.Server.HttpSys/NativeInterop/AddressFamily.cs
index a9938a3a70..239d36533e 100644
--- a/src/Microsoft.AspNetCore.Server.HttpSys/NativeInterop/AddressFamily.cs
+++ b/src/Microsoft.AspNetCore.Server.HttpSys/NativeInterop/AddressFamily.cs
@@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.HttpSys
{
-#if NET451
+#if NET46
///
///
/// Specifies the address families that an instance of the
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/DeferredDisposableLifetime.cs b/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/DeferredDisposableLifetime.cs
deleted file mode 100644
index 8790de29ab..0000000000
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/DeferredDisposableLifetime.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// 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 !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
-using System;
-namespace System.Threading
-{
- internal struct DeferredDisposableLifetime where T : class, IDeferredDisposable
- {
- private int _count;
- public bool AddRef(T obj)
- {
- while (true)
- {
- int num = Volatile.Read(ref this._count);
- if (num < 0)
- {
- break;
- }
- int num2 = checked(num + 1);
- if (Interlocked.CompareExchange(ref this._count, num2, num) == num)
- {
- return true;
- }
- }
- throw new ObjectDisposedException(typeof(T).ToString());
- }
- public void Release(T obj)
- {
- int num2;
- int num3;
- while (true)
- {
- int num = Volatile.Read(ref this._count);
- if (num > 0)
- {
- num2 = num - 1;
- if (Interlocked.CompareExchange(ref this._count, num2, num) == num)
- {
- break;
- }
- }
- else
- {
- num3 = num + 1;
- if (Interlocked.CompareExchange(ref this._count, num3, num) == num)
- {
- goto Block_3;
- }
- }
- }
- if (num2 == 0)
- {
- obj.OnFinalRelease(false);
- }
- return;
- Block_3:
- if (num3 == -1)
- {
- obj.OnFinalRelease(true);
- }
- }
- public void Dispose(T obj)
- {
- int num2;
- while (true)
- {
- int num = Volatile.Read(ref this._count);
- if (num < 0)
- {
- break;
- }
- num2 = -1 - num;
- if (Interlocked.CompareExchange(ref this._count, num2, num) == num)
- {
- goto Block_1;
- }
- }
- return;
- Block_1:
- if (num2 == -1)
- {
- obj.OnFinalRelease(true);
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/IDeferredDisposable.cs b/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/IDeferredDisposable.cs
deleted file mode 100644
index bc1ed90211..0000000000
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/IDeferredDisposable.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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 !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
-using System;
-namespace System.Threading
-{
- internal interface IDeferredDisposable
- {
- void OnFinalRelease(bool disposed);
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/PreAllocatedOverlapped.cs b/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/PreAllocatedOverlapped.cs
deleted file mode 100644
index 92530f048f..0000000000
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/PreAllocatedOverlapped.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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 !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
-using System;
-namespace System.Threading
-{
- internal sealed class PreAllocatedOverlapped : IDisposable, IDeferredDisposable
- {
- internal readonly ThreadPoolBoundHandleOverlapped _overlapped;
- private DeferredDisposableLifetime _lifetime;
- public PreAllocatedOverlapped(IOCompletionCallback callback, object state, object pinData)
- {
- if (callback == null)
- {
- throw new ArgumentNullException("callback");
- }
- this._overlapped = new ThreadPoolBoundHandleOverlapped(callback, state, pinData, this);
- }
- internal bool AddRef()
- {
- return this._lifetime.AddRef(this);
- }
- internal void Release()
- {
- this._lifetime.Release(this);
- }
- public void Dispose()
- {
- this._lifetime.Dispose(this);
- GC.SuppressFinalize(this);
- }
- ~PreAllocatedOverlapped()
- {
- if (!Environment.HasShutdownStarted)
- {
- this.Dispose();
- }
- }
- unsafe void IDeferredDisposable.OnFinalRelease(bool disposed)
- {
- if (disposed)
- {
- Overlapped.Free(this._overlapped._nativeOverlapped);
- return;
- }
- this._overlapped._boundHandle = null;
- this._overlapped._completed = false;
- *this._overlapped._nativeOverlapped = default(NativeOverlapped);
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandle.cs b/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandle.cs
deleted file mode 100644
index bea558e342..0000000000
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandle.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// 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 !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
-using System;
-using System.Runtime.InteropServices;
-namespace System.Threading
-{
- internal sealed class ThreadPoolBoundHandle : IDisposable
- {
- private readonly SafeHandle _handle;
- private bool _isDisposed;
- public SafeHandle Handle
- {
- get
- {
- return this._handle;
- }
- }
- private ThreadPoolBoundHandle(SafeHandle handle)
- {
- this._handle = handle;
- }
- public static ThreadPoolBoundHandle BindHandle(SafeHandle handle)
- {
- if (handle == null)
- {
- throw new ArgumentNullException("handle");
- }
- if (handle.IsClosed || handle.IsInvalid)
- {
- throw new ArgumentException("Invalid Handle", "handle");
- }
- try
- {
- ThreadPool.BindHandle(handle);
- }
- catch (Exception expr_38)
- {
- if (expr_38.HResult == -2147024890)
- {
- throw new ArgumentException("Invalid Handle", "handle");
- }
- if (expr_38.HResult == -2147024809)
- {
- throw new ArgumentException("Already Bound", "handle");
- }
- throw;
- }
- return new ThreadPoolBoundHandle(handle);
- }
-
- public unsafe NativeOverlapped* AllocateNativeOverlapped(IOCompletionCallback callback, object state, object pinData)
- {
- if (callback == null)
- {
- throw new ArgumentNullException("callback");
- }
- this.EnsureNotDisposed();
- return new ThreadPoolBoundHandleOverlapped(callback, state, pinData, null)
- {
- _boundHandle = this
- }._nativeOverlapped;
- }
-
- public unsafe NativeOverlapped* AllocateNativeOverlapped(PreAllocatedOverlapped preAllocated)
- {
- if (preAllocated == null)
- {
- throw new ArgumentNullException("preAllocated");
- }
- this.EnsureNotDisposed();
- preAllocated.AddRef();
- NativeOverlapped* nativeOverlapped;
- try
- {
- ThreadPoolBoundHandleOverlapped expr_21 = preAllocated._overlapped;
- if (expr_21._boundHandle != null)
- {
- throw new ArgumentException("Already Allocated", "preAllocated");
- }
- expr_21._boundHandle = this;
- nativeOverlapped = expr_21._nativeOverlapped;
- }
- catch
- {
- preAllocated.Release();
- throw;
- }
- return nativeOverlapped;
- }
-
- public unsafe void FreeNativeOverlapped(NativeOverlapped* overlapped)
- {
- if (overlapped == null)
- {
- throw new ArgumentNullException("overlapped");
- }
- ThreadPoolBoundHandleOverlapped overlappedWrapper = ThreadPoolBoundHandle.GetOverlappedWrapper(overlapped, this);
- if (overlappedWrapper._boundHandle != this)
- {
- throw new ArgumentException("Wrong bound handle", "overlapped");
- }
- if (overlappedWrapper._preAllocated != null)
- {
- overlappedWrapper._preAllocated.Release();
- return;
- }
- Overlapped.Free(overlapped);
- }
-
- public unsafe static object GetNativeOverlappedState(NativeOverlapped* overlapped)
- {
- if (overlapped == null)
- {
- throw new ArgumentNullException("overlapped");
- }
- return ThreadPoolBoundHandle.GetOverlappedWrapper(overlapped, null)._userState;
- }
- private unsafe static ThreadPoolBoundHandleOverlapped GetOverlappedWrapper(NativeOverlapped* overlapped, ThreadPoolBoundHandle expectedBoundHandle)
- {
- ThreadPoolBoundHandleOverlapped result;
- try
- {
- result = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(overlapped);
- }
- catch (NullReferenceException ex)
- {
- throw new ArgumentException("Already freed", "overlapped", ex);
- }
- return result;
- }
- public void Dispose()
- {
- this._isDisposed = true;
- }
- private void EnsureNotDisposed()
- {
- if (this._isDisposed)
- {
- throw new ObjectDisposedException(base.GetType().ToString());
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandleOverlapped.cs b/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandleOverlapped.cs
deleted file mode 100644
index 1ec336af68..0000000000
--- a/src/Microsoft.AspNetCore.Server.HttpSys/Overlapped/ThreadPoolBoundHandleOverlapped.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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 !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
-using System;
-namespace System.Threading
-{
- internal sealed class ThreadPoolBoundHandleOverlapped : Overlapped
- {
- private readonly IOCompletionCallback _userCallback;
- internal readonly object _userState;
- internal PreAllocatedOverlapped _preAllocated;
- internal unsafe NativeOverlapped* _nativeOverlapped;
- internal ThreadPoolBoundHandle _boundHandle;
- internal bool _completed;
- public unsafe ThreadPoolBoundHandleOverlapped(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated)
- {
- this._userCallback = callback;
- this._userState = state;
- this._preAllocated = preAllocated;
- this._nativeOverlapped = base.Pack(new IOCompletionCallback(ThreadPoolBoundHandleOverlapped.CompletionCallback), pinData);
- this._nativeOverlapped->OffsetLow = 0;
- this._nativeOverlapped->OffsetHigh = 0;
- }
- private unsafe static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped)
- {
- ThreadPoolBoundHandleOverlapped expr_0B = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(nativeOverlapped);
- if (expr_0B._completed)
- {
- throw new InvalidOperationException("Native Overlapped reused");
- }
- expr_0B._completed = true;
- if (expr_0B._boundHandle == null)
- {
- throw new InvalidOperationException("Already freed");
- }
- expr_0B._userCallback.Invoke(errorCode, numBytes, nativeOverlapped);
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/AuthenticationTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/AuthenticationTests.cs
index 358ac346db..c5cddc6e6d 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/AuthenticationTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/AuthenticationTests.cs
@@ -9,7 +9,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
-using AuthenticationSchemes = Microsoft.AspNetCore.Server.HttpSys.AuthenticationSchemes;
namespace Microsoft.AspNetCore.Server.HttpSys
{
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/HttpsTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/HttpsTests.cs
index b0bcb6e612..d42936325d 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/HttpsTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/HttpsTests.cs
@@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
private async Task SendRequestAsync(string uri,
X509Certificate cert = null)
{
-#if NET452
+#if NET46
var handler = new WebRequestHandler();
#elif NETCOREAPP2_0
var handler = new WinHttpHandler();
@@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
private async Task SendRequestAsync(string uri, string upload)
{
-#if NET452
+#if NET46
var handler = new WebRequestHandler();
#elif NETCOREAPP2_0
var handler = new WinHttpHandler();
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/HttpsTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/HttpsTests.cs
index b7a05b5e1f..9075e8e831 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/HttpsTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/HttpsTests.cs
@@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
private async Task SendRequestAsync(string uri,
X509Certificate cert = null)
{
-#if NET452
+#if NET46
WebRequestHandler handler = new WebRequestHandler();
#elif NETCOREAPP2_0
WinHttpHandler handler = new WinHttpHandler();
@@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
private async Task SendRequestAsync(string uri, string upload)
{
-#if NET452
+#if NET46
WebRequestHandler handler = new WebRequestHandler();
#elif NETCOREAPP2_0
WinHttpHandler handler = new WinHttpHandler();
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/RequestBodyTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/RequestBodyTests.cs
index 1c4da2210f..78a37d1af7 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/RequestBodyTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/RequestBodyTests.cs
@@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
Assert.Equal("Hello World", response);
}
}
-#if NET452
+#if NET46
[ConditionalFact]
public async Task RequestBody_ReadBeginEnd_Success()
{
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
index d129e7fbfc..94cafa7255 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
@@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var context = await server.AcceptAsync(Utilities.DefaultTimeout);
context.Response.Headers["Content-lenGth"] = " 30 ";
var stream = context.Response.Body;
-#if NET452
+#if NET46
stream.EndWrite(stream.BeginWrite(new byte[10], 0, 10, null, null));
#elif NETCOREAPP2_0
await stream.WriteAsync(new byte[10], 0, 10);
@@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var context = await server.AcceptAsync(Utilities.DefaultTimeout);
context.Response.Headers["Content-lenGth"] = " 20 ";
context.Dispose();
-#if NET452
+#if NET46
// HttpClient retries the request because it didn't get a response.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
context.Response.Headers["Content-lenGth"] = " 20 ";
@@ -287,7 +287,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var writeTask = context.Response.Body.WriteAsync(new byte[10], 0, 10, cts.Token);
Assert.True(writeTask.IsCanceled);
context.Dispose();
-#if NET452
+#if NET46
// .NET 4.5 HttpClient automatically retries a request if it does not get a response.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
cts = new CancellationTokenSource();
@@ -319,7 +319,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var writeTask = context.Response.Body.WriteAsync(new byte[10], 0, 10, cts.Token);
Assert.True(writeTask.IsCanceled);
context.Dispose();
-#if NET452
+#if NET46
// .NET 4.5 HttpClient automatically retries a request if it does not get a response.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
cts = new CancellationTokenSource();
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
index 4b0c5b8f48..1da87eab2c 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
@@ -223,7 +223,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
-#elif NET452
+#elif NET46
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
#else
#error Target framework needs to be updated
@@ -254,7 +254,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
-#elif NET452
+#elif NET46
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
#else
#error Target framework needs to be updated
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
index 2172157489..b025dff302 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
@@ -362,7 +362,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var writeTask = context.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token);
Assert.True(writeTask.IsCanceled);
context.Dispose();
-#if NET452
+#if NET46
// .NET 4.5 HttpClient automatically retries a request if it does not get a response.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
cts = new CancellationTokenSource();
@@ -394,7 +394,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
var writeTask = context.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token);
Assert.True(writeTask.IsCanceled);
context.Dispose();
-#if NET452
+#if NET46
// .NET 4.5 HttpClient automatically retries a request if it does not get a response.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
cts = new CancellationTokenSource();
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
index fa6a81246e..6633fbbaca 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
@@ -186,7 +186,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
context.Abort();
Assert.True(canceled.WaitOne(interval), "Aborted");
Assert.True(ct.IsCancellationRequested, "IsCancellationRequested");
-#if NET452
+#if NET46
// HttpClient re-tries the request because it doesn't know if the request was received.
context = await server.AcceptAsync(Utilities.DefaultTimeout);
context.Abort();
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/SkipOffDomainAttribute.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/SkipOffDomainAttribute.cs
index 75b956a1b2..f74046ec1d 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/SkipOffDomainAttribute.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/SkipOffDomainAttribute.cs
@@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
{
try
{
-#if NET452
+#if NET46
return !string.IsNullOrEmpty(System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain().Name);
#elif NETCOREAPP2_0
#else
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/Utilities.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/Utilities.cs
index 6b35ade3df..8a5d5d9a55 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/Utilities.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/Utilities.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging;
@@ -25,8 +24,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
static Utilities()
{
var win8Version = new Version(6, 2);
-
-#if NET452
+#if NET46
IsWin8orLater = (Environment.OSVersion.Version >= win8Version);
#elif NETCOREAPP2_0
IsWin8orLater = (new Version(RuntimeEnvironment.OperatingSystemVersion) >= win8Version);
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
index e717078d1b..809f73775c 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
@@ -3,7 +3,7 @@
- netcoreapp2.0;net452
+ netcoreapp2.0;net46
netcoreapp2.0
@@ -16,9 +16,10 @@
+
-
+
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/RequestBodyTests.cs
index 790434bc33..b55b3f9d50 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/RequestBodyTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/RequestBodyTests.cs
@@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
Assert.Equal("Hello World", response);
}
}
-#if NET452
+#if NET46
[ConditionalFact]
public async Task RequestBody_ReadBeginEnd_Success()
{
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseBodyTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseBodyTests.cs
index a55c2aa1d0..f35d322add 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseBodyTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseBodyTests.cs
@@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
{
httpContext.Response.Headers["Content-lenGth"] = " 30 ";
Stream stream = httpContext.Response.Body;
-#if NET452
+#if NET46
stream.EndWrite(stream.BeginWrite(new byte[10], 0, 10, null, null));
#elif NETCOREAPP2_0
await stream.WriteAsync(new byte[10], 0, 10);
@@ -223,7 +223,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync());
}
}
-#if NET452
+#if NET46
[ConditionalFact]
public async Task ResponseBody_BeginWrite_TriggersOnStarting()
{
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
index cd041e15c1..cc9f5ad87c 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
@@ -83,7 +83,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
-#elif NET452
+#elif NET46
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
#else
#error Target framework needs to be updated
@@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
-#elif NET452
+#elif NET46
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
#else
#error Target framework needs to be updated
diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj b/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
index cd0c882e6f..cef136bb6b 100644
--- a/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
+++ b/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
@@ -3,15 +3,12 @@
- netcoreapp2.0;net452
+ netcoreapp2.0;net46
netcoreapp2.0
-
-
-