diff --git a/samples/HelloWorld/project.json b/samples/HelloWorld/project.json index dce1c90459..4f4c0e622f 100644 --- a/samples/HelloWorld/project.json +++ b/samples/HelloWorld/project.json @@ -3,7 +3,7 @@ "Microsoft.Net.Http.Server" : "" }, "frameworks": { - "net45": { }, + "aspnet50": { }, "aspnetcore50" : { "dependencies": { "System.Collections": "4.0.10.0", diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index 972bf20843..4ae5346393 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -7,7 +7,7 @@ }, "commands": { "web": "Microsoft.AspNet.Hosting --server=Microsoft.AspNet.Server.WebListener --server.urls=http://localhost:8080" }, "frameworks": { - "net45": { + "aspnet50": { }, "aspnetcore50": { "dependencies": { diff --git a/src/Microsoft.AspNet.Security.Windows/project.json b/src/Microsoft.AspNet.Security.Windows/project.json index 566ae29eff..710de00f3a 100644 --- a/src/Microsoft.AspNet.Security.Windows/project.json +++ b/src/Microsoft.AspNet.Security.Windows/project.json @@ -5,7 +5,7 @@ "compilationOptions" : { "allowUnsafe": true }, "frameworks": { - "net45" : { + "aspnet50" : { "dependencies": { } } diff --git a/src/Microsoft.AspNet.Server.WebListener/project.json b/src/Microsoft.AspNet.Server.WebListener/project.json index dd5b4c4380..2951f53f89 100644 --- a/src/Microsoft.AspNet.Server.WebListener/project.json +++ b/src/Microsoft.AspNet.Server.WebListener/project.json @@ -13,7 +13,7 @@ "allowUnsafe": true }, "frameworks": { - "net45": {}, + "aspnet50": {}, "aspnetcore50": { "dependencies": { "Microsoft.Win32.Primitives": "4.0.0.0", diff --git a/src/Microsoft.Net.Http.Server/AuthenticationManager.cs b/src/Microsoft.Net.Http.Server/AuthenticationManager.cs index 4d88e5716a..4dd506ba29 100644 --- a/src/Microsoft.Net.Http.Server/AuthenticationManager.cs +++ b/src/Microsoft.Net.Http.Server/AuthenticationManager.cs @@ -39,7 +39,7 @@ namespace Microsoft.Net.Http.Server /// public sealed class AuthenticationManager { -#if NET45 +#if ASPNET50 private static readonly int AuthInfoSize = Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_SERVER_AUTHENTICATION_INFO)); #else @@ -163,7 +163,7 @@ namespace Microsoft.Net.Http.Server && requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth && requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess) { -#if NET45 +#if ASPNET50 return true; #endif } @@ -176,7 +176,7 @@ namespace Microsoft.Net.Http.Server && requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth && requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess) { -#if NET45 +#if ASPNET50 return new WindowsPrincipal(new WindowsIdentity(requestInfo->pInfo->AccessToken, GetAuthTypeFromRequest(requestInfo->pInfo->AuthType).ToString())); #endif diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs b/src/Microsoft.Net.Http.Server/NativeInterop/ComNetOS.cs index 5d78b9a498..ff8c54aa99 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 NET45 +#if ASPNET50 var win8Version = new Version(6, 2); IsWin8orLater = (Environment.OSVersion.Version >= win8Version); #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs b/src/Microsoft.Net.Http.Server/NativeInterop/HttpSysSettings.cs index 94d60a3abb..f55d833576 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 NET45 +#if ASPNET50 using Microsoft.Win32; #endif @@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server { internal static class HttpSysSettings { -#if NET45 +#if ASPNET50 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 !NET45 +#if !ASPNET50 { } #else diff --git a/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs b/src/Microsoft.Net.Http.Server/NativeInterop/NclUtilities.cs index e5934498d9..c3aaec9cb7 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 NET45 +#if ASPNET50 || AppDomain.CurrentDomain.IsFinalizingForUnload() #endif ; diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/OpaqueStream.cs index 8c66cbca9a..54215adb62 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 NET45 +#if ASPNET50 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 NET45 +#if ASPNET50 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/Request.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/Request.cs index daf92329ed..3d03cbc366 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/Request.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/Request.cs @@ -29,7 +29,7 @@ using System.Net; using System.Runtime.InteropServices; using System.Security.Claims; using System.Security.Cryptography.X509Certificates; -#if NET45 +#if ASPNET50 using System.Security.Principal; #endif using System.Threading; diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs index cd14f84ca4..46aa6db146 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestStream.cs @@ -191,7 +191,7 @@ namespace Microsoft.Net.Http.Server } } -#if NET45 +#if ASPNET50 public override unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -283,7 +283,7 @@ namespace Microsoft.Net.Http.Server return asyncResult; } -#if NET45 +#if ASPNET50 public override int EndRead(IAsyncResult asyncResult) #else public int EndRead(IAsyncResult asyncResult) @@ -416,7 +416,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if NET45 +#if ASPNET50 public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -425,7 +425,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_ReadOnlyStream); } -#if NET45 +#if ASPNET50 public override void EndWrite(IAsyncResult asyncResult) #else public 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 6fd6467468..0da68b19bc 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/RequestUriBuilder.cs @@ -57,8 +57,8 @@ namespace Microsoft.Net.Http.Server // // When parsing ANSI (Latin 1) encoded path '/pa%C4th/', %C4 will be added to rawOctets and when // we reach 't', the content of rawOctets { 0xC4 } will be fed into the ANSI encoding. The resulting - // string '�' will be percent encoded into UTF-8 octets and appended to requestUriString. The final - // path will be '/pa%C3%84th/', where '%C3%84' is the UTF-8 percent encoded character '�'. + // string '�' will be percent encoded into UTF-8 octets and appended to requestUriString. The final + // path will be '/pa%C3%84th/', where '%C3%84' is the UTF-8 percent encoded character '�'. private List _rawOctets; private string _rawPath; @@ -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 NET45 +#if ASPNET50 AnsiEncoding = Encoding.GetEncoding(0, new EncoderExceptionFallback(), new DecoderExceptionFallback()); #else AnsiEncoding = Utf8Encoding; diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs index 95193ca2bb..28ea172d40 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs @@ -701,7 +701,7 @@ namespace Microsoft.Net.Http.Server knownHeaderInfo[_nativeResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders; knownHeaderInfo[_nativeResponse.ResponseInfoCount].Length = -#if NET45 +#if ASPNET50 (uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS)); #else (uint)Marshal.SizeOf(); diff --git a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs index 7bdf20953c..3a5b85699d 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStream.cs @@ -197,7 +197,7 @@ namespace Microsoft.Net.Http.Server throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); } -#if NET45 +#if ASPNET50 public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state) { throw new InvalidOperationException(Resources.Exception_WriteOnlyStream); @@ -357,7 +357,7 @@ namespace Microsoft.Net.Http.Server // TODO: Verbose log data written } -#if NET45 +#if ASPNET50 public override unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) #else public unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state) @@ -464,7 +464,7 @@ namespace Microsoft.Net.Http.Server return asyncResult; } -#if NET45 +#if ASPNET50 public override void EndWrite(IAsyncResult asyncResult) #else public 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 6c829cddba..1a14b15485 100644 --- a/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs +++ b/src/Microsoft.Net.Http.Server/RequestProcessing/ResponseStreamAsyncResult.cs @@ -140,7 +140,7 @@ namespace Microsoft.Net.Http.Server overlapped.AsyncResult = this; int bufferSize = 1024 * 64; // TODO: Validate buffer size choice. -#if NET45 +#if ASPNET50 // It's too expensive to validate anything before opening the file. Open the file and then check the lengths. _fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize, FileOptions.Asynchronous | FileOptions.SequentialScan); // Extremely expensive. diff --git a/src/Microsoft.Net.Http.Server/TimeoutManager.cs b/src/Microsoft.Net.Http.Server/TimeoutManager.cs index e7bd3b2236..53f819d99b 100644 --- a/src/Microsoft.Net.Http.Server/TimeoutManager.cs +++ b/src/Microsoft.Net.Http.Server/TimeoutManager.cs @@ -35,7 +35,7 @@ namespace Microsoft.Net.Http.Server /// public sealed class TimeoutManager { -#if NET45 +#if ASPNET50 private static readonly int TimeoutLimitSize = Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_TIMEOUT_LIMIT_INFO)); #else diff --git a/src/Microsoft.Net.Http.Server/WebListener.cs b/src/Microsoft.Net.Http.Server/WebListener.cs index d8d80772dc..d68eceb01d 100644 --- a/src/Microsoft.Net.Http.Server/WebListener.cs +++ b/src/Microsoft.Net.Http.Server/WebListener.cs @@ -44,7 +44,7 @@ namespace Microsoft.Net.Http.Server public sealed class WebListener : IDisposable { private const long DefaultRequestQueueLength = 1000; // Http.sys default. -#if NET45 +#if ASPNET50 private static readonly Type ChannelBindingStatusType = typeof(UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS); private static readonly int RequestChannelBindStatusSize = Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS)); @@ -818,7 +818,7 @@ namespace Microsoft.Net.Http.Server knownHeaderInfo[httpResponse.ResponseInfoCount].Type = UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_INFO_TYPE.HttpResponseInfoTypeMultipleKnownHeaders; knownHeaderInfo[httpResponse.ResponseInfoCount].Length = -#if NET45 +#if ASPNET50 (uint)Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS)); #else (uint)Marshal.SizeOf(); @@ -910,7 +910,7 @@ namespace Microsoft.Net.Http.Server private static int GetTokenOffsetFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); -#if NET45 +#if ASPNET50 IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelToken")); #else IntPtr tokenPointer = Marshal.ReadIntPtr(blob, (int)Marshal.OffsetOf("ChannelToken")); @@ -922,7 +922,7 @@ namespace Microsoft.Net.Http.Server private static int GetTokenSizeFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); -#if NET45 +#if ASPNET50 return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf(ChannelBindingStatusType, "ChannelTokenSize")); #else return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf("ChannelTokenSize")); diff --git a/src/Microsoft.Net.Http.Server/WebListenerException.cs b/src/Microsoft.Net.Http.Server/WebListenerException.cs index a47346c509..e411eccbff 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 NET45 +#if ASPNET50 // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. public override int ErrorCode 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 421412244e..c32fe193c6 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 !NET45 +#if !ASPNET50 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 9e1e783200..93ae53059d 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 !NET45 +#if !ASPNET50 namespace Microsoft.Win32.SafeHandles { @@ -45,4 +45,4 @@ namespace Microsoft.Win32.SafeHandles } } } -#endif \ No newline at end of file +#endif 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 ce9c830d9e..27c11162bb 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 !NET45 +#if !ASPNET50 using System; using System.ComponentModel; @@ -49,4 +49,4 @@ namespace System.Diagnostics } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs b/src/Microsoft.Net.Http.Server/fx/System/ExternDll.cs index cc20e7969c..693cecaf1d 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 !NET45 +#if !ASPNET50 namespace System { @@ -30,4 +30,4 @@ namespace System public const string Kernel32 = "kernel32.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 eae4f7dae2..7ddb66a918 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 !NET45 +#if !ASPNET50 namespace System.Runtime.InteropServices { @@ -112,4 +112,4 @@ namespace System.Runtime.InteropServices } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs b/src/Microsoft.Net.Http.Server/fx/System/SafeNativeMethods.cs index ae88c8bda9..098a797cdd 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 !NET45 +#if !ASPNET50 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 2a7c15f92b..cb314b1c30 100644 --- a/src/Microsoft.Net.Http.Server/project.json +++ b/src/Microsoft.Net.Http.Server/project.json @@ -8,7 +8,7 @@ "allowUnsafe": true }, "frameworks": { - "net45": {}, + "aspnet50": {}, "aspnetcore50": { "dependencies": { "Microsoft.Net.WebSocketAbstractions": "1.0.0-*", diff --git a/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs b/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs index 2bbf1c58bf..02de75baaa 100644 --- a/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs +++ b/src/Microsoft.Net.WebSockets/NativeInterop/SafeNativeOverlapped.cs @@ -87,7 +87,7 @@ namespace Microsoft.Net.WebSockets get { return Environment.HasShutdownStarted -#if NET45 +#if ASPNET50 || AppDomain.CurrentDomain.IsFinalizingForUnload() #endif ; diff --git a/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs b/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs index c2002b7f22..de2d07588f 100644 --- a/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets/NativeInterop/UnsafeNativeMethods.cs @@ -161,7 +161,7 @@ namespace Microsoft.Net.WebSockets static WebSocketProtocolComponent() { -#if NET45 +#if ASPNET50 DllFileName = Path.Combine(Environment.SystemDirectory, WEBSOCKET); #else DllFileName = Path.Combine(Environment.GetEnvironmentVariable("SYSTEMROOT"), "System32", WEBSOCKET); diff --git a/src/Microsoft.Net.WebSockets/WebSocketBase.cs b/src/Microsoft.Net.WebSockets/WebSocketBase.cs index 30c9ebc9d5..d845cc1625 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketBase.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketBase.cs @@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets if (thisLockTaken || sessionHandleLockTaken) { -#if NET45 +#if ASPNET50 RuntimeHelpers.PrepareConstrainedRegions(); #endif try @@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); if (lockTaken) { -#if NET45 +#if ASPNET50 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 NET45 +#if ASPNET50 if (ExecutionContext.IsFlowSuppressed()) { _keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite); diff --git a/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs b/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs index a34b458f7c..7378812572 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketBuffer.cs @@ -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 NET45 +#if ASPNET50 private static readonly int SizeOfUInt = Marshal.SizeOf(typeof(uint)); private static readonly int SizeOfBool = Marshal.SizeOf(typeof(bool)); #else @@ -713,4 +713,4 @@ namespace Microsoft.Net.WebSockets public const int SendPayloadSpecified = 1; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.Net.WebSockets/WebSocketException.cs b/src/Microsoft.Net.WebSockets/WebSocketException.cs index 1e923616ad..74ee1663e8 100644 --- a/src/Microsoft.Net.WebSockets/WebSocketException.cs +++ b/src/Microsoft.Net.WebSockets/WebSocketException.cs @@ -28,7 +28,7 @@ using System.Runtime.InteropServices; namespace Microsoft.Net.WebSockets { -#if NET45 +#if ASPNET50 [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 9e1e783200..93ae53059d 100644 --- a/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs +++ b/src/Microsoft.Net.WebSockets/fx/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs @@ -21,7 +21,7 @@ // // ==--== -#if !NET45 +#if !ASPNET50 namespace Microsoft.Win32.SafeHandles { @@ -45,4 +45,4 @@ namespace Microsoft.Win32.SafeHandles } } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs b/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs index f7aa7f941f..7c0f5bf195 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/AccessViolationException.cs +++ b/src/Microsoft.Net.WebSockets/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 !NET45 +#if !ASPNET50 using System; using System.Collections.Generic; @@ -30,4 +30,4 @@ namespace System } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs b/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs index ce75afbf7e..bdd0fa07bd 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/ComponentModel/Win32Exception.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if !NET45 +#if !ASPNET50 using System.Runtime.InteropServices; using System.Text; @@ -126,4 +126,4 @@ namespace System.ComponentModel } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs b/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs index cc20e7969c..693cecaf1d 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/ExternDll.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if !NET45 +#if !ASPNET50 namespace System { @@ -30,4 +30,4 @@ namespace System public const string Kernel32 = "kernel32.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 eae4f7dae2..7ddb66a918 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/Runtime/InteropServices/ExternalException.cs @@ -31,7 +31,7 @@ ** =============================================================================*/ -#if !NET45 +#if !ASPNET50 namespace System.Runtime.InteropServices { @@ -112,4 +112,4 @@ namespace System.Runtime.InteropServices } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs b/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs index ae88c8bda9..098a797cdd 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs +++ b/src/Microsoft.Net.WebSockets/fx/System/SafeNativeMethods.cs @@ -21,7 +21,7 @@ // //------------------------------------------------------------------------------ -#if !NET45 +#if !ASPNET50 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 b6d2d3e3f3..3ab212bca4 100644 --- a/src/Microsoft.Net.WebSockets/fx/System/SystemException.cs +++ b/src/Microsoft.Net.WebSockets/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 !NET45 +#if !ASPNET50 using System; using System.Collections.Generic; @@ -30,4 +30,4 @@ namespace System } } -#endif \ No newline at end of file +#endif diff --git a/src/Microsoft.Net.WebSockets/project.json b/src/Microsoft.Net.WebSockets/project.json index 7fd3a3907e..b61f880017 100644 --- a/src/Microsoft.Net.WebSockets/project.json +++ b/src/Microsoft.Net.WebSockets/project.json @@ -5,7 +5,7 @@ }, "compilationOptions" : { "allowUnsafe": true }, "frameworks": { - "net45" : { }, + "aspnet50" : { }, "aspnetcore50" : { "dependencies": { "Microsoft.Win32.Primitives": "4.0.0.0", diff --git a/test/Microsoft.AspNet.Security.Windows.Test/project.json b/test/Microsoft.AspNet.Security.Windows.Test/project.json index 37e979b7da..f4e5ecfa6f 100644 --- a/test/Microsoft.AspNet.Security.Windows.Test/project.json +++ b/test/Microsoft.AspNet.Security.Windows.Test/project.json @@ -8,7 +8,7 @@ "xunit.execution": "2.0.0-aspnet-*" }, "frameworks": { - "net45": { + "aspnet50": { "dependencies": { "System.Net.Http": "", "System.Net.Http.WebRequest": "" diff --git a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs index 8a92ce2a04..f630a6a85f 100644 --- a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/RequestBodyTests.cs @@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Server.WebListener Assert.Equal("Hello World", response); } } -#if NET45 +#if ASPNET50 [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 e9c9096e41..edff879192 100644 --- a/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNet.Server.WebListener.FunctionalTests/project.json @@ -15,7 +15,7 @@ "Xunit.KRunner": "1.0.0-*" }, "frameworks": { - "net45": { + "aspnet50": { "dependencies": { "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 de847e9331..d7ca42c3c9 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 NET45 +#if ASPNET50 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { @@ -402,4 +402,4 @@ namespace Microsoft.Net.Http.Server } } } -} \ No newline at end of file +} diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index fa9c4b849a..0c0784e8e7 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -7,7 +7,7 @@ "Xunit.KRunner": "1.0.0-*" }, "frameworks": { - "net45": { + "aspnet50": { "dependencies": { "System.Net.Http": "", "System.Net.Http.WebRequest": "",