From 6c467b0475c59be9877e94f59482dffdbc422a02 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 22 Oct 2015 12:34:25 -0700 Subject: [PATCH] Switch packages to use generation TFMs --- .../project.json | 10 +++- .../NativeInterop/ComNetOS.cs | 4 +- .../NativeInterop/HttpSysSettings.cs | 8 +-- .../NativeInterop/NclUtilities.cs | 4 +- .../NativeInterop/UnsafeNativeMethods.cs | 28 +++++----- .../Overlapped/DeferredDisposableLifetime.cs | 2 +- .../Overlapped/IDeferredDisposable.cs | 2 +- .../Overlapped/PreAllocatedOverlapped.cs | 2 +- .../Overlapped/ThreadPoolBoundHandle.cs | 2 +- .../ThreadPoolBoundHandleOverlapped.cs | 2 +- .../RequestProcessing/OpaqueStream.cs | 6 +- .../RequestProcessing/RequestStream.cs | 10 ++-- .../RequestProcessing/RequestUriBuilder.cs | 4 +- .../RequestProcessing/ResponseStream.cs | 8 +-- .../ResponseStreamAsyncResult.cs | 4 +- .../WebListenerException.cs | 4 +- .../CriticalHandleZeroOrMinusOneIsInvalid.cs | 4 +- .../SafeHandleZeroOrMinusOneIsInvalid.cs | 4 +- .../fx/System/Diagnostics/TraceEventType.cs | 4 +- .../fx/System/ExternDll.cs | 4 +- .../InteropServices/ExternalException.cs | 4 +- .../fx/System/SafeNativeMethods.cs | 4 +- src/Microsoft.Net.Http.Server/project.json | 49 ++++++++-------- .../NativeInterop/UnsafeNativeMethods.cs | 10 ++-- src/Microsoft.Net.WebSockets/WebSocketBase.cs | 12 ++-- .../WebSocketException.cs | 4 +- .../SafeHandleZeroOrMinusOneIsInvalid.cs | 4 +- .../fx/System/AccessViolationException.cs | 4 +- .../System/ComponentModel/Win32Exception.cs | 4 +- .../fx/System/ExternDll.cs | 4 +- .../InteropServices/ExternalException.cs | 4 +- .../fx/System/SafeNativeMethods.cs | 4 +- .../fx/System/SystemException.cs | 4 +- src/Microsoft.Net.WebSockets/project.json | 56 +++++++++---------- 34 files changed, 144 insertions(+), 139 deletions(-) diff --git a/src/Microsoft.AspNet.Server.WebListener/project.json b/src/Microsoft.AspNet.Server.WebListener/project.json index 323f1f29e6..683d0223a1 100644 --- a/src/Microsoft.AspNet.Server.WebListener/project.json +++ b/src/Microsoft.AspNet.Server.WebListener/project.json @@ -10,11 +10,17 @@ "allowUnsafe": true }, "frameworks": { - "dnx451": { }, + "dnx451": {}, + "net451": { }, "dnxcore50": { "dependencies": { "System.Security.Claims": "4.0.1-beta-*" } + }, + "dotnet5.4": { + "dependencies": { + "System.Security.Claims": "4.0.1-beta-*" + } } } -} +} \ 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 8a6a9d3b8f..11333417cb 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server static ComNetOS() { -#if DNXCORE50 +#if DOTNET5_4 // 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 7af55371da..46e3aee54d 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Security; -#if !DNXCORE50 +#if !DOTNET5_4 using Microsoft.Win32; #endif @@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server { internal static class HttpSysSettings { -#if !DNXCORE50 +#if !DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 { } #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs index 5514a946e6..8c939d7bc2 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs +++ b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server get { return Environment.HasShutdownStarted -#if !DNXCORE50 +#if !DOTNET5_4 || 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 d6dcb837d3..e9171f7a8a 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 DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 724741009a..80ac921a01 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/DeferredDisposableLifetime.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 // TODO: Temp copy. Remove once we target net46. +#if !DOTNET5_4 // 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 7b6395b588..57bf6b41f7 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/IDeferredDisposable.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 // TODO: Temp copy. Remove once we target net46. +#if !DOTNET5_4 // 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 c4c7b468af..465c816391 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/PreAllocatedOverlapped.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 // TODO: Temp copy. Remove once we target net46. +#if !DOTNET5_4 // 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 2e3234c206..3b7ad7d966 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandle.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 // TODO: Temp copy. Remove once we target net46. +#if !DOTNET5_4 // 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 7020223dba..753ee35ffd 100644 --- a/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs +++ b/src/Microsoft.Net.Http.Server/Overlapped/ThreadPoolBoundHandleOverlapped.cs @@ -1,4 +1,4 @@ -#if !DNXCORE50 // TODO: Temp copy. Remove once we target net46. +#if !DOTNET5_4 // 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 2dd9c0b4ee..4889a8c41b 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -109,7 +109,7 @@ namespace Microsoft.Net.Http.Server { return _requestStream.ReadByte(); } -#if !DNXCORE50 +#if !DOTNET5_4 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 !DNXCORE50 +#if !DOTNET5_4 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 3678b298e4..162c8d683e 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -203,7 +203,7 @@ namespace Microsoft.Net.Http.Server } } -#if DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 public void EndWrite(IAsyncResult asyncResult) #else public override void EndWrite(IAsyncResult asyncResult) diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs index 2bd1cf2b6d..971a10bff8 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -70,7 +70,7 @@ namespace Microsoft.Net.Http.Server // TODO: False triggers more detailed/correct parsing, but it's rather slow. UseCookedRequestUrl = true; // SettingsSectionInternal.Section.HttpListenerUnescapeRequestUrl; Utf8Encoding = new UTF8Encoding(false, true); -#if DNXCORE50 +#if DOTNET5_4 AnsiEncoding = Utf8Encoding; #else AnsiEncoding = Encoding.GetEncoding(0, new EncoderExceptionFallback(), new DecoderExceptionFallback()); diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs index 6cc412dba5..579dd1bbe2 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -379,7 +379,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); } -#if !DNXCORE50 +#if !DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 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 3510080030..43e9b6c027 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -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 DNXCORE50 +#if DOTNET5_4 _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 7ad45db7eb..8920b3fd25 100644 --- a/src/Microsoft.Net.Http.Server/WebListenerException.cs +++ b/src/Microsoft.Net.Http.Server/WebListenerException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,7 +45,7 @@ namespace Microsoft.Net.Http.Server : base(errorCode, message) { } -#if DNXCORE50 +#if DOTNET5_4 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 727e8414df..4a310df3bf 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 @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // // ==--== -#if DNXCORE50 +#if DOTNET5_4 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 01654cbb97..650cffcf86 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 @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // // ==--== -#if DNXCORE50 +#if DOTNET5_4 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 b51311aeca..bb8a238cf1 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/Diagnostics/TraceEventType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 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 5604c4f1fe..0aa12a91e5 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 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 89d705b071..1d6c825a65 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 @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,7 @@ ** =============================================================================*/ -#if DNXCORE50 +#if DOTNET5_4 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 265ed0113a..d890c46b3f 100644 --- a/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs +++ b/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 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 acd00516e8..143a302dd8 100644 --- a/src/Microsoft.Net.Http.Server/project.json +++ b/src/Microsoft.Net.Http.Server/project.json @@ -1,27 +1,26 @@ { - "version": "1.0.0-*", - "description": "Implementation of WebListener, a successor to HttpListener. It is used in the WebListener server package.", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.Primitives": "1.0.0-*", - "Microsoft.Net.WebSockets": "1.0.0-*" - }, - "compilationOptions": { - "allowUnsafe": true - }, - "frameworks": { - "net451": { }, - "dnx451": { }, - "dnxcore50": { - "dependencies": { - "Microsoft.Win32.Primitives": "4.0.1-beta-*", - "System.Diagnostics.Debug": "4.0.11-beta-*", - "System.IO.FileSystem": "4.0.1-beta-*", - "System.Security.Claims": "4.0.1-beta-*", - "System.Security.Cryptography.X509Certificates": "4.0.0-beta-*", - "System.Security.Principal.Windows": "4.0.0-beta-*", - "System.Threading.Overlapped": "4.0.0" - } - } + "version": "1.0.0-*", + "description": "Implementation of WebListener, a successor to HttpListener. It is used in the WebListener server package.", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", + "Microsoft.Extensions.Primitives": "1.0.0-*", + "Microsoft.Net.WebSockets": "1.0.0-*" + }, + "compilationOptions": { + "allowUnsafe": true + }, + "frameworks": { + "net451": {}, + "dotnet5.4": { + "dependencies": { + "Microsoft.Win32.Primitives": "4.0.1-beta-*", + "System.Diagnostics.Debug": "4.0.11-beta-*", + "System.IO.FileSystem": "4.0.1-beta-*", + "System.Security.Claims": "4.0.1-beta-*", + "System.Security.Cryptography.X509Certificates": "4.0.0-beta-*", + "System.Security.Principal.Windows": "4.0.0-beta-*", + "System.Threading.Overlapped": "4.0.0-beta-*" + } } -} + } +} \ No newline at end of file diff --git a/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs b/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs index c0d176fb5e..8b81c7cd96 100644 --- a/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,7 @@ namespace Microsoft.Net.WebSockets { internal static class UnsafeNativeMethods { -#if DNXCORE50 +#if DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 [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 DNXCORE50 +#if DOTNET5_4 DllFileName = Path.Combine(Environment.GetEnvironmentVariable("SYSTEMROOT"), "System32", WEBSOCKET); #else DllFileName = Path.Combine(Environment.SystemDirectory, WEBSOCKET); diff --git a/src/Microsoft.Net.WebSockets/WebSocketBase.cs b/src/Microsoft.Net.WebSockets/WebSocketBase.cs index 0d6fa52dba..6629e35271 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketBase.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -482,7 +482,7 @@ namespace Microsoft.Net.WebSockets _state = WebSocketState.Aborted; -#if DEBUG && NET45 +#if DEBUG && NET451 string stackTrace = new StackTrace().ToString(); if (_closeStack == null) { @@ -715,7 +715,7 @@ namespace Microsoft.Net.WebSockets _state = WebSocketState.Closed; -#if DEBUG && NET45 +#if DEBUG && NET451 if (_closeStack == null) { _closeStack = new StackTrace().ToString(); @@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets if (thisLockTaken || sessionHandleLockTaken) { -#if !DNXCORE50 +#if !DOTNET5_4 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); if (lockTaken) { -#if !DNXCORE50 +#if !DOTNET5_4 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 DNXCORE50 +#if DOTNET5_4 _keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite); #else if (ExecutionContext.IsFlowSuppressed()) diff --git a/src/Microsoft.Net.WebSockets/WebSocketException.cs b/src/Microsoft.Net.WebSockets/WebSocketException.cs index a8f0b34c45..9724b91448 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketException.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,7 @@ using System.Runtime.InteropServices; namespace Microsoft.Net.WebSockets { -#if !DNXCORE50 +#if !DOTNET5_4 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")] #endif internal sealed class WebSocketException : Win32Exception diff --git a/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs b/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs index 01654cbb97..650cffcf86 100644 --- a/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs +++ b/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // // ==--== -#if DNXCORE50 +#if DOTNET5_4 namespace Microsoft.Win32.SafeHandles { diff --git a/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs b/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs index 2baee3aab3..b7f6eb4071 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +15,7 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -#if DNXCORE50 +#if DOTNET5_4 using System; using System.Collections.Generic; diff --git a/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs b/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs index 2ff15c2f89..5c6d0dea8b 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 using System.Runtime.InteropServices; using System.Text; diff --git a/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs b/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs index 5604c4f1fe..0aa12a91e5 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 namespace System { diff --git a/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs b/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs index 89d705b071..1d6c825a65 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,7 @@ ** =============================================================================*/ -#if DNXCORE50 +#if DOTNET5_4 namespace System.Runtime.InteropServices { diff --git a/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs b/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs index 265ed0113a..d890c46b3f 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if DNXCORE50 +#if DOTNET5_4 using System.Runtime.InteropServices; using System.Text; diff --git a/src/Microsoft.Net.WebSockets/fx/System/SystemException.cs b/src/Microsoft.Net.WebSockets/fx/System/SystemException.cs index 4f74937813..023d53ffc9 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/SystemException.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/SystemException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +15,7 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -#if DNXCORE50 +#if DOTNET5_4 using System; using System.Collections.Generic; diff --git a/src/Microsoft.Net.WebSockets/project.json b/src/Microsoft.Net.WebSockets/project.json index 23db5571cb..b25f6378d3 100644 --- a/src/Microsoft.Net.WebSockets/project.json +++ b/src/Microsoft.Net.WebSockets/project.json @@ -1,30 +1,30 @@ { - "version": "1.0.0-*", - "description": "Implementation of WebSocket abstract base class. Used by WebListener.", - "dependencies": { - }, - "compilationOptions": { "allowUnsafe": true }, - "frameworks": { - "net451": { }, - "dnx451": { }, - "dnxcore50": { - "dependencies": { - "System.Collections": "4.0.11-beta-*", - "System.Diagnostics.Contracts": "4.0.1-beta-*", - "System.Diagnostics.Tools": "4.0.1-beta-*", - "System.IO": "4.0.11-beta-*", - "System.Linq": "4.0.1-beta-*", - "System.Net.Primitives": "4.0.11-beta-*", - "System.Net.WebSockets": "4.0.0-beta-*", - "System.Resources.ResourceManager": "4.0.1-beta-*", - "System.Runtime.Extensions": "4.0.11-beta-*", - "System.Security.Cryptography.Algorithms": "4.0.0-beta-*", - "System.Text.Encoding.Extensions": "4.0.11-beta-*", - "System.Threading": "4.0.11-beta-*", - "System.Threading.Tasks": "4.0.11-beta-*", - "System.Threading.Timer": "4.0.1-beta-*", - "System.Threading.ThreadPool": "4.0.10-beta-*" - } - } + "version": "1.0.0-*", + "description": "Implementation of WebSocket abstract base class. Used by WebListener.", + "dependencies": {}, + "compilationOptions": { + "allowUnsafe": true + }, + "frameworks": { + "net451": {}, + "dotnet5.4": { + "dependencies": { + "System.Collections": "4.0.11-beta-*", + "System.Diagnostics.Contracts": "4.0.1-beta-*", + "System.Diagnostics.Tools": "4.0.1-beta-*", + "System.IO": "4.0.11-beta-*", + "System.Linq": "4.0.1-beta-*", + "System.Net.Primitives": "4.0.11-beta-*", + "System.Net.WebSockets": "4.0.0-beta-*", + "System.Resources.ResourceManager": "4.0.1-beta-*", + "System.Runtime.Extensions": "4.0.11-beta-*", + "System.Security.Cryptography.Algorithms": "4.0.0-beta-*", + "System.Text.Encoding.Extensions": "4.0.11-beta-*", + "System.Threading": "4.0.11-beta-*", + "System.Threading.Tasks": "4.0.11-beta-*", + "System.Threading.Timer": "4.0.1-beta-*", + "System.Threading.ThreadPool": "4.0.10-beta-*" + } } -} + } +} \ No newline at end of file