diff --git a/samples/HelloWorld/project.json b/samples/HelloWorld/project.json index 9ef4235..3f7f295 100644 --- a/samples/HelloWorld/project.json +++ b/samples/HelloWorld/project.json @@ -1,10 +1,10 @@ -{ +{ "dependencies": { "Microsoft.Net.Http.Server": "1.0.0-*" }, "frameworks": { - "aspnet50": { }, - "aspnetcore50": { + "dnx451": { }, + "dnxcore50": { "dependencies": { "System.Collections": "4.0.10-beta-*", "System.Console": "4.0.0-beta-*", diff --git a/samples/HotAddSample/project.json b/samples/HotAddSample/project.json index ab2ef37..600caef 100644 --- a/samples/HotAddSample/project.json +++ b/samples/HotAddSample/project.json @@ -17,7 +17,7 @@ "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:12345" }, "frameworks" : { - "aspnet50" : { }, - "aspnetcore50" : { } + "dnx451" : { }, + "dnxcore50" : { } } } diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index aded313..bffc397 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -1,4 +1,4 @@ -{ +{ "webroot": "wwwroot", "dependencies": { "Microsoft.AspNet.Hosting": "1.0.0-*", @@ -7,7 +7,7 @@ }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:8080" }, "frameworks": { - "aspnet50": { }, - "aspnetcore50": { } + "dnx451": { }, + "dnxcore50": { } } } diff --git a/src/Microsoft.AspNet.Server.WebListener/project.json b/src/Microsoft.AspNet.Server.WebListener/project.json index e1ae359..b0fc4b6 100644 --- a/src/Microsoft.AspNet.Server.WebListener/project.json +++ b/src/Microsoft.AspNet.Server.WebListener/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "description": "ASP.NET 5 self-host web server.", "dependencies": { @@ -15,7 +15,7 @@ "allowUnsafe": true }, "frameworks": { - "aspnet50": { }, - "aspnetcore50": { } + "dnx451": { }, + "dnxcore50": { } } } diff --git a/src/Microsoft.Net.Http.Server/AuthenticationManager.cs b/src/Microsoft.Net.Http.Server/AuthenticationManager.cs index adb806c..d0a43e5 100644 --- a/src/Microsoft.Net.Http.Server/AuthenticationManager.cs +++ b/src/Microsoft.Net.Http.Server/AuthenticationManager.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"); @@ -38,7 +38,7 @@ namespace Microsoft.Net.Http.Server /// public sealed class AuthenticationManager { -#if ASPNETCORE50 +#if DNXCORE50 private static readonly int AuthInfoSize = Marshal.SizeOf(); #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs b/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs index 030b152..8a6a9d3 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 ASPNETCORE50 +#if DNXCORE50 // 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 1d6daab..7af5537 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 !ASPNETCORE50 +#if !DNXCORE50 using Microsoft.Win32; #endif @@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server { internal static class HttpSysSettings { -#if !ASPNETCORE50 +#if !DNXCORE50 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 ASPNETCORE50 +#if DNXCORE50 { } #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs index 2e6d3c4..5514a94 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 !ASPNETCORE50 +#if !DNXCORE50 || 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 262f327..054375c 100644 --- a/src/Microsoft.Net.Http.Server/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Microsoft.Net.Http.Server/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"); @@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server { private const string HTTPAPI = "httpapi.dll"; -#if ASPNETCORE50 +#if DNXCORE50 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"; @@ -59,21 +59,21 @@ namespace Microsoft.Net.Http.Server internal const uint ERROR_CONNECTION_INVALID = 1229; } -#if ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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)] @@ -90,7 +90,7 @@ namespace Microsoft.Net.Http.Server internal static class SafeNetHandles { -#if ASPNETCORE50 +#if DNXCORE50 [DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(SECUR32, ExactSpelling = true, SetLastError = true)] @@ -98,7 +98,7 @@ namespace Microsoft.Net.Http.Server internal static extern int FreeContextBuffer( [In] IntPtr contextBuffer); -#if ASPNETCORE50 +#if DNXCORE50 [DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)] #else [DllImport(SECUR32, ExactSpelling = true, SetLastError = true)] @@ -115,21 +115,21 @@ namespace Microsoft.Net.Http.Server [DllImport(HTTPAPI, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)] internal static extern unsafe uint HttpCloseRequestQueue(IntPtr pReqQueueHandle); -#if ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [DllImport(api_ms_win_core_heap_obsolete_LIB, EntryPoint = "LocalAlloc", SetLastError = true)] #else [DllImport(KERNEL32, EntryPoint = "LocalAlloc", SetLastError = true)] @@ -137,21 +137,21 @@ namespace Microsoft.Net.Http.Server internal static extern SafeLocalFreeChannelBinding LocalAllocChannelBinding(int uFlags, UIntPtr sizetdwBytes); -#if ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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/RequestProcessing/OpaqueStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs index 9d6ab5b..2dd9c0b 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 !ASPNETCORE50 +#if !DNXCORE50 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 !ASPNETCORE50 +#if !DNXCORE50 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 cbeaa2f..d32cb54 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"); @@ -198,7 +198,7 @@ namespace Microsoft.Net.Http.Server } } -#if ASPNETCORE50 +#if DNXCORE50 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) @@ -291,7 +291,7 @@ namespace Microsoft.Net.Http.Server return asyncResult; } -#if ASPNETCORE50 +#if DNXCORE50 public int EndRead(IAsyncResult asyncResult) #else public override int EndRead(IAsyncResult asyncResult) @@ -426,7 +426,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if ASPNETCORE50 +#if DNXCORE50 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) @@ -435,7 +435,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if ASPNETCORE50 +#if DNXCORE50 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 a9301ea..2bd1cf2 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 ASPNETCORE50 +#if DNXCORE50 AnsiEncoding = Utf8Encoding; #else AnsiEncoding = Encoding.GetEncoding(0, new EncoderExceptionFallback(), new DecoderExceptionFallback()); diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs index 50be415..0ab0251 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/Response.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"); @@ -709,7 +709,7 @@ namespace Microsoft.Net.Http.Server knownHeaderInfo[_nativeResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders; knownHeaderInfo[_nativeResponse.ResponseInfoCount].Length = -#if ASPNETCORE50 +#if DNXCORE50 (uint)Marshal.SizeOf(); #else (uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS)); diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs index cbe64f4..feec8fe 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"); @@ -195,7 +195,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); } -#if !ASPNETCORE50 +#if !DNXCORE50 public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) { throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); @@ -360,7 +360,7 @@ namespace Microsoft.Net.Http.Server // TODO: Verbose log data written } -#if ASPNETCORE50 +#if DNXCORE50 public unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public override unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -465,7 +465,7 @@ namespace Microsoft.Net.Http.Server return asyncResult; } -#if ASPNETCORE50 +#if DNXCORE50 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 c7b71d2..16c2e21 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"); @@ -140,7 +140,7 @@ namespace Microsoft.Net.Http.Server overlapped.AsyncResult = this; int bufferSize = 1024 * 64; // TODO: Validate buffer size choice. -#if ASPNETCORE50 +#if DNXCORE50 _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/TimeoutManager.cs b/src/Microsoft.Net.Http.Server/TimeoutManager.cs index 29160fe..6ef2ca5 100644 --- a/src/Microsoft.Net.Http.Server/TimeoutManager.cs +++ b/src/Microsoft.Net.Http.Server/TimeoutManager.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"); @@ -35,7 +35,7 @@ namespace Microsoft.Net.Http.Server /// public sealed class TimeoutManager { -#if ASPNETCORE50 +#if DNXCORE50 private static readonly int TimeoutLimitSize = Marshal.SizeOf(); #else diff --git a/src/Microsoft.Net.Http.Server/WebListener.cs b/src/Microsoft.Net.Http.Server/WebListener.cs index 3185a41..856a77f 100644 --- a/src/Microsoft.Net.Http.Server/WebListener.cs +++ b/src/Microsoft.Net.Http.Server/WebListener.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"); @@ -41,7 +41,7 @@ namespace Microsoft.Net.Http.Server public sealed class WebListener : IDisposable { private const long DefaultRequestQueueLength = 1000; // Http.sys default. -#if ASPNETCORE50 +#if DNXCORE50 private static readonly int RequestChannelBindStatusSize = Marshal.SizeOf(); private static readonly int BindingInfoSize = @@ -749,7 +749,7 @@ namespace Microsoft.Net.Http.Server knownHeaderInfo[httpResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders; knownHeaderInfo[httpResponse.ResponseInfoCount].Length = -#if ASPNETCORE50 +#if DNXCORE50 (uint)Marshal.SizeOf(); #else (uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS)); @@ -841,7 +841,7 @@ namespace Microsoft.Net.Http.Server private static int GetTokenOffsetFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); -#if ASPNETCORE50 +#if DNXCORE50 IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf("ChannelToken")); #else IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelToken")); @@ -853,7 +853,7 @@ namespace Microsoft.Net.Http.Server private static int GetTokenSizeFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); -#if ASPNETCORE50 +#if DNXCORE50 return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf("ChannelTokenSize")); #else return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelTokenSize")); diff --git a/src/Microsoft.Net.Http.Server/WebListenerException.cs b/src/Microsoft.Net.Http.Server/WebListenerException.cs index 0b31af9..7ad45db 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 ASPNETCORE50 +#if DNXCORE50 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 cdfef44..727e841 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 ASPNETCORE50 +#if DNXCORE50 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 5e1b351..01654cb 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 ASPNETCORE50 +#if DNXCORE50 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 b58cb2b..b51311a 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 ASPNETCORE50 +#if DNXCORE50 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 d0c06fa..5604c4f 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 ASPNETCORE50 +#if DNXCORE50 namespace System { @@ -30,4 +30,4 @@ namespace System public const string api_ms_win_core_localization_LIB = "api-ms-win-core-localization-l2-1-0.dll"; } } -#endif \ No newline at end of file +#endif 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 ff4cc36..89d705b 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 ASPNETCORE50 +#if DNXCORE50 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 4fdd2d4..265ed01 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 ASPNETCORE50 +#if DNXCORE50 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 d7f2167..1d9950a 100644 --- a/src/Microsoft.Net.Http.Server/project.json +++ b/src/Microsoft.Net.Http.Server/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "description": "Implementation of WebListener, a successor to HttpListener. It is used in the WebListener server package.", "dependencies": { @@ -10,8 +10,8 @@ }, "frameworks": { "net45": { }, - "aspnet50": { }, - "aspnetcore50": { + "dnx451": { }, + "dnxcore50": { "dependencies": { "Microsoft.Win32.Primitives": "4.0.0-beta-*", "System.Diagnostics.Debug": "4.0.10-beta-*", diff --git a/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs b/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs index 57fa756..b5501b0 100644 --- a/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs +++ b/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.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"); @@ -87,7 +87,7 @@ namespace Microsoft.Net.WebSockets get { return Environment.HasShutdownStarted -#if !ASPNETCORE50 +#if !DNXCORE50 || AppDomain.CurrentDomain.IsFinalizingForUnload() #endif ; diff --git a/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs b/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs index b365a0a..c0d176f 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 ASPNETCORE50 +#if DNXCORE50 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 ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 [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 ASPNETCORE50 +#if DNXCORE50 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 4254062..0d6fa52 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"); @@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets if (thisLockTaken || sessionHandleLockTaken) { -#if !ASPNETCORE50 +#if !DNXCORE50 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); if (lockTaken) { -#if !ASPNETCORE50 +#if !DNXCORE50 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 ASPNETCORE50 +#if DNXCORE50 _keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite); #else if (ExecutionContext.IsFlowSuppressed()) diff --git a/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs b/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs index 62323a1..8230117 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketBuffer.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"); @@ -50,7 +50,7 @@ namespace Microsoft.Net.WebSockets public const int MinSendBufferSize = 16; internal const int MinReceiveBufferSize = 256; internal const int MaxBufferSize = 64 * 1024; -#if ASPNETCORE50 +#if DNXCORE50 private static readonly int SizeOfUInt = Marshal.SizeOf(); private static readonly int SizeOfBool = Marshal.SizeOf(); #else diff --git a/src/Microsoft.Net.WebSockets/WebSocketException.cs b/src/Microsoft.Net.WebSockets/WebSocketException.cs index 6dd5d72..a8f0b34 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 !ASPNETCORE50 +#if !DNXCORE50 [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 5e1b351..01654cb 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 ASPNETCORE50 +#if DNXCORE50 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 97e4ee0..2baee3a 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 ASPNETCORE50 +#if DNXCORE50 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 73f28a2..2ff15c2 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 ASPNETCORE50 +#if DNXCORE50 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 d0c06fa..5604c4f 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 ASPNETCORE50 +#if DNXCORE50 namespace System { @@ -30,4 +30,4 @@ namespace System public const string api_ms_win_core_localization_LIB = "api-ms-win-core-localization-l2-1-0.dll"; } } -#endif \ No newline at end of file +#endif 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 ff4cc36..89d705b 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 ASPNETCORE50 +#if DNXCORE50 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 4fdd2d4..265ed01 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 ASPNETCORE50 +#if DNXCORE50 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 5bcc7ae..4f74937 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 ASPNETCORE50 +#if DNXCORE50 using System; using System.Collections.Generic; diff --git a/src/Microsoft.Net.WebSockets/project.json b/src/Microsoft.Net.WebSockets/project.json index b36dc2a..87fba4f 100644 --- a/src/Microsoft.Net.WebSockets/project.json +++ b/src/Microsoft.Net.WebSockets/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "description": "Implementation of WebSocket abstract base class. Used by WebListener.", "dependencies": { @@ -7,7 +7,7 @@ "compilationOptions": { "allowUnsafe": true }, "frameworks": { "net45": { }, - "aspnetcore50": { + "dnxcore50": { "dependencies": { "System.Collections": "4.0.10-beta-*", "System.Diagnostics.Contracts": "4.0.0-beta-*", diff --git a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs index fefa2e0..9763e76 100644 --- a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.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"); @@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Server.WebListener Assert.Equal("Hello World", response); } } -#if !ASPNETCORE50 +#if !DNXCORE50 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { diff --git a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json index 76420d3..b41a6fa 100644 --- a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json @@ -1,4 +1,4 @@ -{ +{ "commands": { "test": "xunit.runner.kre" }, @@ -9,7 +9,7 @@ "xunit.runner.kre": "1.0.0-*" }, "frameworks": { - "aspnet50": { + "dnx451": { "frameworkAssemblies": { "System.Net.Http": "", "System.Net.Http.WebRequest": "" diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs index 606aa6c..98f1b28 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/RequestBodyTests.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.IO; @@ -51,7 +51,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal("Hello World", response); } } -#if ASPNET50 +#if DNX451 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index f0db29a..9b537c0 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -1,4 +1,4 @@ -{ +{ "commands": { "test": "xunit.runner.kre" }, @@ -8,7 +8,7 @@ "xunit.runner.kre": "1.0.0-*" }, "frameworks": { - "aspnet50": { + "dnx451": { frameworkAssemblies: { "System.Net.Http": "", "System.Net.Http.WebRequest": ""