Updated to use the new target framework in project.json

This commit is contained in:
David Fowler 2014-09-04 01:44:15 -07:00
parent a7e97313b5
commit a1c2f68a58
43 changed files with 73 additions and 73 deletions

View File

@ -3,7 +3,7 @@
"Microsoft.Net.Http.Server" : ""
},
"frameworks": {
"net45": { },
"aspnet50": { },
"aspnetcore50" : {
"dependencies": {
"System.Collections": "4.0.10.0",

View File

@ -7,7 +7,7 @@
},
"commands": { "web": "Microsoft.AspNet.Hosting --server=Microsoft.AspNet.Server.WebListener --server.urls=http://localhost:8080" },
"frameworks": {
"net45": {
"aspnet50": {
},
"aspnetcore50": {
"dependencies": {

View File

@ -5,7 +5,7 @@
"compilationOptions" : { "allowUnsafe": true },
"frameworks":
{
"net45" : {
"aspnet50" : {
"dependencies": {
}
}

View File

@ -13,7 +13,7 @@
"allowUnsafe": true
},
"frameworks": {
"net45": {},
"aspnet50": {},
"aspnetcore50": {
"dependencies": {
"Microsoft.Win32.Primitives": "4.0.0.0",

View File

@ -39,7 +39,7 @@ namespace Microsoft.Net.Http.Server
/// </summary>
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

View File

@ -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

View File

@ -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

View File

@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
get
{
return Environment.HasShutdownStarted
#if NET45
#if ASPNET50
|| AppDomain.CurrentDomain.IsFinalizingForUnload()
#endif
;

View File

@ -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);

View File

@ -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;

View File

@ -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)

View File

@ -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 '<EFBFBD>' 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 '<EFBFBD>'.
// 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<byte> _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;

View File

@ -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<UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS>();

View File

@ -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)

View File

@ -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.

View File

@ -35,7 +35,7 @@ namespace Microsoft.Net.Http.Server
/// </summary>
public sealed class TimeoutManager
{
#if NET45
#if ASPNET50
private static readonly int TimeoutLimitSize =
Marshal.SizeOf(typeof(UnsafeNclNativeMethods.HttpApi.HTTP_TIMEOUT_LIMIT_INFO));
#else

View File

@ -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<UnsafeNclNativeMethods.HttpApi.HTTP_MULTIPLE_KNOWN_HEADERS>();
@ -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<UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS>("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<UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_CHANNEL_BIND_STATUS>("ChannelTokenSize"));

View File

@ -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

View File

@ -21,7 +21,7 @@
//
// ==--==
#if !NET45
#if !ASPNET50
namespace Microsoft.Win32.SafeHandles
{

View File

@ -21,7 +21,7 @@
//
// ==--==
#if !NET45
#if !ASPNET50
namespace Microsoft.Win32.SafeHandles
{
@ -45,4 +45,4 @@ namespace Microsoft.Win32.SafeHandles
}
}
}
#endif
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
using System;
using System.ComponentModel;
@ -49,4 +49,4 @@ namespace System.Diagnostics
}
}
#endif
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
namespace System
{
@ -30,4 +30,4 @@ namespace System
public const string Kernel32 = "kernel32.dll";
}
}
#endif
#endif

View File

@ -31,7 +31,7 @@
**
=============================================================================*/
#if !NET45
#if !ASPNET50
namespace System.Runtime.InteropServices
{
@ -112,4 +112,4 @@ namespace System.Runtime.InteropServices
}
}
#endif
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
using System.Runtime.InteropServices;
using System.Text;

View File

@ -8,7 +8,7 @@
"allowUnsafe": true
},
"frameworks": {
"net45": {},
"aspnet50": {},
"aspnetcore50": {
"dependencies": {
"Microsoft.Net.WebSocketAbstractions": "1.0.0-*",

View File

@ -87,7 +87,7 @@ namespace Microsoft.Net.WebSockets
get
{
return Environment.HasShutdownStarted
#if NET45
#if ASPNET50
|| AppDomain.CurrentDomain.IsFinalizingForUnload()
#endif
;

View File

@ -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);

View File

@ -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);

View File

@ -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;
}
}
}
}

View File

@ -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

View File

@ -21,7 +21,7 @@
//
// ==--==
#if !NET45
#if !ASPNET50
namespace Microsoft.Win32.SafeHandles
{
@ -45,4 +45,4 @@ namespace Microsoft.Win32.SafeHandles
}
}
}
#endif
#endif

View File

@ -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
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
using System.Runtime.InteropServices;
using System.Text;
@ -126,4 +126,4 @@ namespace System.ComponentModel
}
}
#endif
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
namespace System
{
@ -30,4 +30,4 @@ namespace System
public const string Kernel32 = "kernel32.dll";
}
}
#endif
#endif

View File

@ -31,7 +31,7 @@
**
=============================================================================*/
#if !NET45
#if !ASPNET50
namespace System.Runtime.InteropServices
{
@ -112,4 +112,4 @@ namespace System.Runtime.InteropServices
}
}
#endif
#endif

View File

@ -21,7 +21,7 @@
// </copyright>
//------------------------------------------------------------------------------
#if !NET45
#if !ASPNET50
using System.Runtime.InteropServices;
using System.Text;

View File

@ -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
#endif

View File

@ -5,7 +5,7 @@
},
"compilationOptions" : { "allowUnsafe": true },
"frameworks": {
"net45" : { },
"aspnet50" : { },
"aspnetcore50" : {
"dependencies": {
"Microsoft.Win32.Primitives": "4.0.0.0",

View File

@ -8,7 +8,7 @@
"xunit.execution": "2.0.0-aspnet-*"
},
"frameworks": {
"net45": {
"aspnet50": {
"dependencies": {
"System.Net.Http": "",
"System.Net.Http.WebRequest": ""

View File

@ -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()
{

View File

@ -15,7 +15,7 @@
"Xunit.KRunner": "1.0.0-*"
},
"frameworks": {
"net45": {
"aspnet50": {
"dependencies": {
"System.Net.Http": "",
"System.Net.Http.WebRequest": "",

View File

@ -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
}
}
}
}
}

View File

@ -7,7 +7,7 @@
"Xunit.KRunner": "1.0.0-*"
},
"frameworks": {
"net45": {
"aspnet50": {
"dependencies": {
"System.Net.Http": "",
"System.Net.Http.WebRequest": "",