diff --git a/samples/HelloWorld/project.json b/samples/HelloWorld/project.json index 2bdad3b44c..2d80d1f40d 100644 --- a/samples/HelloWorld/project.json +++ b/samples/HelloWorld/project.json @@ -9,14 +9,17 @@ }, "frameworks": { "dnx451": {}, - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "System.Collections": "4.0.11-*", "System.Console": "4.0.0-*", "System.Globalization": "4.0.11-*", "System.IO": "4.1.0-*", "System.Threading.Tasks": "4.0.11-*" - } + }, + "imports": [ + "dnxcore50" + ] } } } \ No newline at end of file diff --git a/samples/HotAddSample/project.json b/samples/HotAddSample/project.json index 9eb1fe1013..dde0f7325a 100644 --- a/samples/HotAddSample/project.json +++ b/samples/HotAddSample/project.json @@ -13,6 +13,10 @@ }, "frameworks": { "dnx451": {}, - "dnxcore50": {} + "netstandardapp1.5": { + "imports": [ + "dnxcore50" + ] + } } } \ No newline at end of file diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index ded562b37c..e31b464c7b 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -12,6 +12,10 @@ }, "frameworks": { "dnx451": {}, - "dnxcore50": {} + "netstandardapp1.5": { + "imports": [ + "dnxcore50" + ] + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Server.WebListener/project.json b/src/Microsoft.AspNetCore.Server.WebListener/project.json index 3c73aa60b2..b2a504e17f 100644 --- a/src/Microsoft.AspNetCore.Server.WebListener/project.json +++ b/src/Microsoft.AspNetCore.Server.WebListener/project.json @@ -10,16 +10,21 @@ "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "frameworks": { "net451": {}, - "dotnet5.4": { + "netstandard1.3": { "dependencies": { "System.Security.Claims": "4.0.1-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dotnet5.4", + "portable-net451+win8" + ] } } } \ No newline at end of file diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs b/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs index 11333417cb..e48bc24d6b 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs @@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server static ComNetOS() { -#if DOTNET5_4 +#if NETSTANDARD1_3 // TODO: SkipIOCPCallbackOnSuccess doesn't work on Win7. Need a way to detect Win7 vs 8+. IsWin8orLater = false; #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs b/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs index 46e3aee54d..946345193c 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs @@ -26,7 +26,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Security; -#if !DOTNET5_4 +#if !NETSTANDARD1_3 using Microsoft.Win32; #endif @@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server { internal static class HttpSysSettings { -#if !DOTNET5_4 +#if !NETSTANDARD1_3 private const string HttpSysParametersKey = @"System\CurrentControlSet\Services\HTTP\Parameters"; #endif private const bool EnableNonUtf8Default = true; @@ -61,7 +61,7 @@ namespace Microsoft.Net.Http.Server } private static void ReadHttpSysRegistrySettings() -#if DOTNET5_4 +#if NETSTANDARD1_3 { } #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs index 8c939d7bc2..7901200e79 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs @@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server get { return Environment.HasShutdownStarted -#if !DOTNET5_4 +#if !NETSTANDARD1_3 || AppDomain.CurrentDomain.IsFinalizingForUnload() #endif ; diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/UnsafeNativeMethods.cs b/src/Microsoft.Net.Http.Server/NativeInterop/UnsafeNativeMethods.cs index e9171f7a8a..8329a27cab 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/UnsafeNativeMethods.cs @@ -33,7 +33,7 @@ namespace Microsoft.Net.Http.Server { private const string HTTPAPI = "httpapi.dll"; -#if DOTNET5_4 +#if NETSTANDARD1_3 private const string sspicli_LIB = "sspicli.dll"; private const string api_ms_win_core_processthreads_LIB = "api-ms-win-core-processthreads-l1-1-1.dll"; private const string api_ms_win_core_io_LIB = "api-ms-win-core-io-l1-1-1.dll"; @@ -63,21 +63,21 @@ namespace Microsoft.Net.Http.Server internal const uint ERROR_CONNECTION_INVALID = 1229; } -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_processthreads_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] #endif internal static extern uint GetCurrentThreadId(); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_io_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] #endif internal static unsafe extern uint CancelIoEx(SafeHandle handle, SafeNativeOverlapped overlapped); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_kernel32_legacy_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] @@ -102,7 +102,7 @@ namespace Microsoft.Net.Http.Server [Out] out HeapAllocHandle resultList); // http://msdn.microsoft.com/en-us/library/windows/desktop/aa366569(v=vs.85).aspx -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_heap_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)] #else [DllImport(KERNEL32, CallingConvention = CallingConvention.Winapi, SetLastError = true)] @@ -110,7 +110,7 @@ namespace Microsoft.Net.Http.Server internal static extern IntPtr GetProcessHeap(); // http://msdn.microsoft.com/en-us/library/windows/desktop/aa366701(v=vs.85).aspx -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_heap_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)] #else [DllImport(KERNEL32, CallingConvention = CallingConvention.Winapi, SetLastError = true)] @@ -122,7 +122,7 @@ namespace Microsoft.Net.Http.Server internal static class SafeNetHandles { -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(SECUR32, ExactSpelling = true, SetLastError = true)] @@ -130,7 +130,7 @@ namespace Microsoft.Net.Http.Server internal static extern int FreeContextBuffer( [In] IntPtr contextBuffer); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(SECUR32, ExactSpelling = true, SetLastError = true)] @@ -147,21 +147,21 @@ namespace Microsoft.Net.Http.Server [DllImport(HTTPAPI, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] internal static extern unsafe uint HttpCloseRequestQueue(IntPtr pReqQueueHandle); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_handle_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)] #endif internal static extern bool CloseHandle(IntPtr handle); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)] #endif internal static extern SafeLocalFree LocalAlloc(int uFlags, UIntPtr sizetdwBytes); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_heap_obsolete_LIB, EntryPoint = "LocalAlloc", SetLastError = true)] #else [DllImport(KERNEL32, EntryPoint = "LocalAlloc", SetLastError = true)] @@ -169,21 +169,21 @@ namespace Microsoft.Net.Http.Server internal static extern SafeLocalFreeChannelBinding LocalAllocChannelBinding(int uFlags, UIntPtr sizetdwBytes); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)] #endif internal static extern IntPtr LocalFree(IntPtr handle); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] #endif internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)] diff --git a/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs b/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs index 80ac921a01..a897da7d0e 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs @@ -1,4 +1,4 @@ -#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46. +#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46. using System; namespace System.Threading { diff --git a/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs b/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs index 57bf6b41f7..b45b7a2c8f 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs @@ -1,4 +1,4 @@ -#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46. +#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46. using System; namespace System.Threading { diff --git a/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs b/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs index 92572dc9f4..7d30b4e248 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs @@ -1,4 +1,4 @@ -#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46. +#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46. using System; namespace System.Threading { diff --git a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs index 595d347a57..4356a57f7a 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs @@ -1,4 +1,4 @@ -#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46. +#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46. using System; using System.Runtime.InteropServices; namespace System.Threading diff --git a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs index 753ee35ffd..55e5458f04 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs @@ -1,4 +1,4 @@ -#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46. +#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46. using System; namespace System.Threading { diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs index 4889a8c41b..6de4a8b38d 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs @@ -109,7 +109,7 @@ namespace Microsoft.Net.Http.Server { return _requestStream.ReadByte(); } -#if !DOTNET5_4 +#if !NETSTANDARD1_3 public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return _requestStream.BeginRead(buffer, offset, count, callback, state); @@ -143,7 +143,7 @@ namespace Microsoft.Net.Http.Server { _responseStream.WriteByte(value); } -#if !DOTNET5_4 +#if !NETSTANDARD1_3 public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return _responseStream.BeginWrite(buffer, offset, count, callback, state); diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs index 162c8d683e..059dfe6822 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs @@ -203,7 +203,7 @@ namespace Microsoft.Net.Http.Server } } -#if DOTNET5_4 +#if NETSTANDARD1_3 public unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public override unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -293,7 +293,7 @@ namespace Microsoft.Net.Http.Server return asyncResult; } -#if DOTNET5_4 +#if NETSTANDARD1_3 public int EndRead(IAsyncResult asyncResult) #else public override int EndRead(IAsyncResult asyncResult) @@ -428,7 +428,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if DOTNET5_4 +#if NETSTANDARD1_3 public IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -437,7 +437,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if DOTNET5_4 +#if NETSTANDARD1_3 public void EndWrite(IAsyncResult asyncResult) #else public override void EndWrite(IAsyncResult asyncResult) diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs index 579dd1bbe2..fc0919602b 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs @@ -379,7 +379,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); } -#if !DOTNET5_4 +#if !NETSTANDARD1_3 public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); @@ -468,7 +468,7 @@ namespace Microsoft.Net.Http.Server } } -#if DOTNET5_4 +#if NETSTANDARD1_3 public unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) #else public override unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) @@ -476,7 +476,7 @@ namespace Microsoft.Net.Http.Server { return WriteAsync(buffer, offset, count).ToIAsyncResult(callback, state); } -#if DOTNET5_4 +#if NETSTANDARD1_3 public void EndWrite(IAsyncResult asyncResult) #else public override void EndWrite(IAsyncResult asyncResult) diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs index 43e9b6c027..dbb9f9e557 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs @@ -120,7 +120,7 @@ namespace Microsoft.Net.Http.Server var boundHandle = responseStream.RequestContext.Server.BoundHandle; int bufferSize = 1024 * 64; // TODO: Validate buffer size choice. -#if DOTNET5_4 +#if NETSTANDARD1_3 _fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize /*, useAsync: true*/); // Extremely expensive. #else // It's too expensive to validate anything before opening the file. Open the file and then check the lengths. diff --git a/src/Microsoft.Net.Http.Server/WebListenerException.cs b/src/Microsoft.Net.Http.Server/WebListenerException.cs index 8920b3fd25..3c0cb7bb89 100644 --- a/src/Microsoft.Net.Http.Server/WebListenerException.cs +++ b/src/Microsoft.Net.Http.Server/WebListenerException.cs @@ -45,7 +45,7 @@ namespace Microsoft.Net.Http.Server : base(errorCode, message) { } -#if DOTNET5_4 +#if NETSTANDARD1_3 public int ErrorCode #else // the base class returns the HResult with this property diff --git a/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs b/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs index 4a310df3bf..5b29a3bc4c 100644 --- a/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs +++ b/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs @@ -21,7 +21,7 @@ // // ==--== -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace Microsoft.Win32.SafeHandles { diff --git a/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs b/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs index 650cffcf86..aef2c8b323 100644 --- a/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs +++ b/src/Microsoft.Net.Http.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs @@ -21,7 +21,7 @@ // // ==--== -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace Microsoft.Win32.SafeHandles { diff --git a/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs b/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs index bb8a238cf1..89ded72c3a 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DOTNET5_4 +#if NETSTANDARD1_3 using System; using System.ComponentModel; diff --git a/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs b/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs index 0aa12a91e5..989211c70c 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace System { diff --git a/src/Microsoft.Net.Http.Server/fx/System/Runtime/InteropServices/ExternalException.cs b/src/Microsoft.Net.Http.Server/fx/System/Runtime/InteropServices/ExternalException.cs index 1d6c825a65..807bdd2a60 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/Runtime/InteropServices/ExternalException.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/Runtime/InteropServices/ExternalException.cs @@ -31,7 +31,7 @@ ** =============================================================================*/ -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace System.Runtime.InteropServices { diff --git a/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs b/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs index d890c46b3f..27a17a745c 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DOTNET5_4 +#if NETSTANDARD1_3 using System.Runtime.InteropServices; using System.Text; diff --git a/src/Microsoft.Net.Http.Server/project.json b/src/Microsoft.Net.Http.Server/project.json index 5b5861dd58..8d12e7b336 100644 --- a/src/Microsoft.Net.Http.Server/project.json +++ b/src/Microsoft.Net.Http.Server/project.json @@ -9,12 +9,14 @@ "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "frameworks": { "net451": {}, - "dotnet5.4": { + "netstandard1.3": { "dependencies": { "Microsoft.Win32.Primitives": "4.0.1-*", "System.Diagnostics.Contracts": "4.0.1-*", @@ -29,7 +31,10 @@ "System.Security.Principal.Windows": "4.0.0-*", "System.Text.Encoding.Extensions": "4.0.11-*", "System.Threading.Overlapped": "4.0.1-*" - } + }, + "imports": [ + "dotnet5.4" + ] } } } \ No newline at end of file diff --git a/src/Microsoft.Net.WebSockets.Server/NativeInterop/UnsafeNativeMethods.cs b/src/Microsoft.Net.WebSockets.Server/NativeInterop/UnsafeNativeMethods.cs index 8b81c7cd96..43c86e1fa2 100644 --- a/src/Microsoft.Net.WebSockets.Server/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets.Server/NativeInterop/UnsafeNativeMethods.cs @@ -31,7 +31,7 @@ namespace Microsoft.Net.WebSockets { internal static class UnsafeNativeMethods { -#if DOTNET5_4 +#if NETSTANDARD1_3 private const string api_ms_win_core_libraryloader_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll"; #else private const string KERNEL32 = "kernel32.dll"; @@ -40,14 +40,14 @@ namespace Microsoft.Net.WebSockets internal static class SafeNetHandles { -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, CharSet=CharSet.Unicode, SetLastError = true)] #endif internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags); -#if DOTNET5_4 +#if NETSTANDARD1_3 [DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)] @@ -173,7 +173,7 @@ namespace Microsoft.Net.WebSockets static WebSocketProtocolComponent() { -#if DOTNET5_4 +#if NETSTANDARD1_3 DllFileName = Path.Combine(Environment.GetEnvironmentVariable("SYSTEMROOT"), "System32", WEBSOCKET); #else DllFileName = Path.Combine(Environment.SystemDirectory, WEBSOCKET); diff --git a/src/Microsoft.Net.WebSockets.Server/WebSocketBase.cs b/src/Microsoft.Net.WebSockets.Server/WebSocketBase.cs index 6629e35271..1526acd056 100644 --- a/src/Microsoft.Net.WebSockets.Server/WebSocketBase.cs +++ b/src/Microsoft.Net.WebSockets.Server/WebSocketBase.cs @@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets if (thisLockTaken || sessionHandleLockTaken) { -#if !DOTNET5_4 +#if !NETSTANDARD1_3 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); if (lockTaken) { -#if !DOTNET5_4 +#if !NETSTANDARD1_3 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -2253,7 +2253,7 @@ namespace Microsoft.Net.WebSockets "'webSocket.m_KeepAliveTracker' MUST NOT be NULL at this point."); int keepAliveIntervalMilliseconds = (int)_keepAliveInterval.TotalMilliseconds; Contract.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE."); -#if DOTNET5_4 +#if NETSTANDARD1_3 _keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite); #else if (ExecutionContext.IsFlowSuppressed()) diff --git a/src/Microsoft.Net.WebSockets.Server/WebSocketException.cs b/src/Microsoft.Net.WebSockets.Server/WebSocketException.cs index 0ae7e4bb89..a906a5d6aa 100644 --- a/src/Microsoft.Net.WebSockets.Server/WebSocketException.cs +++ b/src/Microsoft.Net.WebSockets.Server/WebSocketException.cs @@ -28,7 +28,7 @@ using System.Runtime.InteropServices; namespace Microsoft.Net.WebSockets { -#if !DOTNET5_4 +#if !NETSTANDARD1_3 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")] #endif internal sealed class WebSocketException : Win32Exception @@ -115,7 +115,7 @@ namespace Microsoft.Net.WebSockets : base(message, innerException) { } -#if !DOTNET5_4 +#if !NETSTANDARD1_3 public override int ErrorCode { get diff --git a/src/Microsoft.Net.WebSockets.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs b/src/Microsoft.Net.WebSockets.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs index 650cffcf86..aef2c8b323 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs @@ -21,7 +21,7 @@ // // ==--== -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace Microsoft.Win32.SafeHandles { diff --git a/src/Microsoft.Net.WebSockets.Server/fx/System/AccessViolationException.cs b/src/Microsoft.Net.WebSockets.Server/fx/System/AccessViolationException.cs index b7f6eb4071..0345bbc1a1 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/System/AccessViolationException.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/System/AccessViolationException.cs @@ -15,7 +15,7 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -#if DOTNET5_4 +#if NETSTANDARD1_3 using System; using System.Collections.Generic; diff --git a/src/Microsoft.Net.WebSockets.Server/fx/System/ExternDll.cs b/src/Microsoft.Net.WebSockets.Server/fx/System/ExternDll.cs index 0aa12a91e5..989211c70c 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/System/ExternDll.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/System/ExternDll.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace System { diff --git a/src/Microsoft.Net.WebSockets.Server/fx/System/Runtime/InteropServices/ExternalException.cs b/src/Microsoft.Net.WebSockets.Server/fx/System/Runtime/InteropServices/ExternalException.cs index 1d6c825a65..807bdd2a60 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/System/Runtime/InteropServices/ExternalException.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/System/Runtime/InteropServices/ExternalException.cs @@ -31,7 +31,7 @@ ** =============================================================================*/ -#if DOTNET5_4 +#if NETSTANDARD1_3 namespace System.Runtime.InteropServices { diff --git a/src/Microsoft.Net.WebSockets.Server/fx/System/SafeNativeMethods.cs b/src/Microsoft.Net.WebSockets.Server/fx/System/SafeNativeMethods.cs index d890c46b3f..27a17a745c 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/System/SafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/System/SafeNativeMethods.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DOTNET5_4 +#if NETSTANDARD1_3 using System.Runtime.InteropServices; using System.Text; diff --git a/src/Microsoft.Net.WebSockets.Server/fx/System/SystemException.cs b/src/Microsoft.Net.WebSockets.Server/fx/System/SystemException.cs index 023d53ffc9..3b4436eb4e 100644 --- a/src/Microsoft.Net.WebSockets.Server/fx/System/SystemException.cs +++ b/src/Microsoft.Net.WebSockets.Server/fx/System/SystemException.cs @@ -15,7 +15,7 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -#if DOTNET5_4 +#if NETSTANDARD1_3 using System; using System.Collections.Generic; diff --git a/src/Microsoft.Net.WebSockets.Server/project.json b/src/Microsoft.Net.WebSockets.Server/project.json index 7d83e64239..11497df423 100644 --- a/src/Microsoft.Net.WebSockets.Server/project.json +++ b/src/Microsoft.Net.WebSockets.Server/project.json @@ -8,12 +8,14 @@ "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "frameworks": { "net451": {}, - "dotnet5.4": { + "netstandard1.3": { "dependencies": { "System.Collections": "4.0.11-*", "System.Linq": "4.1.0-*", @@ -25,7 +27,10 @@ "System.Threading.Tasks": "4.0.11-*", "System.Threading.Timer": "4.0.1-*", "System.Threading.ThreadPool": "4.0.10-*" - } + }, + "imports": [ + "dotnet5.4" + ] } } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs index f11949a4e7..12944d9b8a 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal("Hello World", response); } } -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs index 4ec53b2a36..7242b3d17c 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs @@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); @@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json index 001a9e016a..3d671edbdf 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json @@ -7,14 +7,17 @@ "xunit": "2.1.0" }, "frameworks": { - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Requests": "4.0.11-*", "System.Net.WebHeaderCollection": "4.0.1-*", "dotnet-test-xunit": "1.0.0-dev-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dnxcore50", + "portable-net451+win8" + ] }, "net451": { "frameworkAssemblies": { @@ -27,4 +30,4 @@ } } } -} +} \ No newline at end of file diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs index 39dc2adcbc..3b195b2fc2 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs @@ -153,7 +153,7 @@ namespace Microsoft.Net.Http.Server var context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; context.Dispose(); -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; @@ -175,7 +175,7 @@ namespace Microsoft.Net.Http.Server context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Body.Write(new byte[5], 0, 5); context.Dispose(); -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; @@ -199,7 +199,7 @@ namespace Microsoft.Net.Http.Server context.Response.Body.Write(new byte[5], 0, 5); Assert.Throws(() => context.Response.Body.Write(new byte[6], 0, 6)); context.Dispose(); -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 10 "; diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs index ffaa2442d6..a3c29a0991 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; using System.Linq; @@ -217,7 +217,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); @@ -246,7 +246,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs index 9de25a8e0c..c1d87dfc0c 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs @@ -123,7 +123,7 @@ namespace Microsoft.Net.Http.Server context.Abort(); Assert.True(canceled.WaitOne(interval), "Aborted"); Assert.True(ct.IsCancellationRequested, "IsCancellationRequested"); -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 // HttpClient re-tries the request because it doesn't know if the request was received. context = await server.GetContextAsync(); context.Abort(); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index 1abe854726..c5dd6a27b7 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -8,7 +8,7 @@ "xunit": "2.1.0" }, "frameworks": { - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "System.Net.Http": "4.0.1-*", "System.Net.Http.WinHttpHandler": "4.0.0-*", @@ -16,7 +16,10 @@ "System.Net.WebSockets.Client": "4.0.0-*", "dotnet-test-xunit": "1.0.0-dev-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dnxcore50", + "portable-net451+win8" + ] }, "net451": { "frameworkAssemblies": { @@ -31,4 +34,4 @@ } } } -} +} \ No newline at end of file