Transition to netstandard.
- dotnet5.X => netstandard1.y (where y = x-1). - DNXCore50 => netstandardapp1.5. - Applied the same changes to ifdefs.
This commit is contained in:
Родитель
eafda23e80
Коммит
5433130182
|
@ -9,14 +9,17 @@
|
|||
},
|
||||
"frameworks": {
|
||||
"dnx451": {},
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"dependencies": {
|
||||
"System.Collections": "4.0.11-*",
|
||||
"System.Console": "4.0.0-*",
|
||||
"System.Globalization": "4.0.11-*",
|
||||
"System.IO": "4.1.0-*",
|
||||
"System.Threading.Tasks": "4.0.11-*"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"dnxcore50"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,10 @@
|
|||
},
|
||||
"frameworks": {
|
||||
"dnx451": {},
|
||||
"dnxcore50": {}
|
||||
"netstandardapp1.5": {
|
||||
"imports": [
|
||||
"dnxcore50"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,6 +12,10 @@
|
|||
},
|
||||
"frameworks": {
|
||||
"dnx451": {},
|
||||
"dnxcore50": {}
|
||||
"netstandardapp1.5": {
|
||||
"imports": [
|
||||
"dnxcore50"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,16 +10,21 @@
|
|||
"allowUnsafe": true,
|
||||
"warningsAsErrors": true,
|
||||
"keyFile": "../../tools/Key.snk",
|
||||
"nowarn": [ "CS1591" ],
|
||||
"nowarn": [
|
||||
"CS1591"
|
||||
],
|
||||
"xmlDoc": true
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {},
|
||||
"dotnet5.4": {
|
||||
"netstandard1.3": {
|
||||
"dependencies": {
|
||||
"System.Security.Claims": "4.0.1-*"
|
||||
},
|
||||
"imports": "portable-net451+win8"
|
||||
"imports": [
|
||||
"dotnet5.4",
|
||||
"portable-net451+win8"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
|
|||
|
||||
static ComNetOS()
|
||||
{
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
// TODO: SkipIOCPCallbackOnSuccess doesn't work on Win7. Need a way to detect Win7 vs 8+.
|
||||
IsWin8orLater = false;
|
||||
#else
|
||||
|
|
|
@ -26,7 +26,7 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
using Microsoft.Win32;
|
||||
#endif
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace Microsoft.Net.Http.Server
|
|||
{
|
||||
internal static class HttpSysSettings
|
||||
{
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
private const string HttpSysParametersKey = @"System\CurrentControlSet\Services\HTTP\Parameters";
|
||||
#endif
|
||||
private const bool EnableNonUtf8Default = true;
|
||||
|
@ -61,7 +61,7 @@ namespace Microsoft.Net.Http.Server
|
|||
}
|
||||
|
||||
private static void ReadHttpSysRegistrySettings()
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
{
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Server
|
|||
get
|
||||
{
|
||||
return Environment.HasShutdownStarted
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
|| AppDomain.CurrentDomain.IsFinalizingForUnload()
|
||||
#endif
|
||||
;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Microsoft.Net.Http.Server
|
|||
{
|
||||
private const string HTTPAPI = "httpapi.dll";
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
private const string sspicli_LIB = "sspicli.dll";
|
||||
private const string api_ms_win_core_processthreads_LIB = "api-ms-win-core-processthreads-l1-1-1.dll";
|
||||
private const string api_ms_win_core_io_LIB = "api-ms-win-core-io-l1-1-1.dll";
|
||||
|
@ -63,21 +63,21 @@ namespace Microsoft.Net.Http.Server
|
|||
internal const uint ERROR_CONNECTION_INVALID = 1229;
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_processthreads_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern uint GetCurrentThreadId();
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_io_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
#endif
|
||||
internal static unsafe extern uint CancelIoEx(SafeHandle handle, SafeNativeOverlapped overlapped);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_kernel32_legacy_LIB, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
|
@ -102,7 +102,7 @@ namespace Microsoft.Net.Http.Server
|
|||
[Out] out HeapAllocHandle resultList);
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa366569(v=vs.85).aspx
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_heap_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
|
@ -110,7 +110,7 @@ namespace Microsoft.Net.Http.Server
|
|||
internal static extern IntPtr GetProcessHeap();
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa366701(v=vs.85).aspx
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_heap_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
|
@ -122,7 +122,7 @@ namespace Microsoft.Net.Http.Server
|
|||
|
||||
internal static class SafeNetHandles
|
||||
{
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(SECUR32, ExactSpelling = true, SetLastError = true)]
|
||||
|
@ -130,7 +130,7 @@ namespace Microsoft.Net.Http.Server
|
|||
internal static extern int FreeContextBuffer(
|
||||
[In] IntPtr contextBuffer);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(sspicli_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(SECUR32, ExactSpelling = true, SetLastError = true)]
|
||||
|
@ -147,21 +147,21 @@ namespace Microsoft.Net.Http.Server
|
|||
[DllImport(HTTPAPI, ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
||||
internal static extern unsafe uint HttpCloseRequestQueue(IntPtr pReqQueueHandle);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_handle_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern bool CloseHandle(IntPtr handle);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern SafeLocalFree LocalAlloc(int uFlags, UIntPtr sizetdwBytes);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_heap_obsolete_LIB, EntryPoint = "LocalAlloc", SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, EntryPoint = "LocalAlloc", SetLastError = true)]
|
||||
|
@ -169,21 +169,21 @@ namespace Microsoft.Net.Http.Server
|
|||
|
||||
internal static extern SafeLocalFreeChannelBinding LocalAllocChannelBinding(int uFlags, UIntPtr sizetdwBytes);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_heap_obsolete_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern IntPtr LocalFree(IntPtr handle);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46.
|
||||
#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
|
||||
using System;
|
||||
namespace System.Threading
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46.
|
||||
#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
|
||||
using System;
|
||||
namespace System.Threading
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46.
|
||||
#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
|
||||
using System;
|
||||
namespace System.Threading
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46.
|
||||
#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
namespace System.Threading
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !DOTNET5_4 // TODO: Temp copy. Remove once we target net46.
|
||||
#if !NETSTANDARD1_3 // TODO: Temp copy. Remove once we target net46.
|
||||
using System;
|
||||
namespace System.Threading
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace Microsoft.Net.Http.Server
|
|||
{
|
||||
return _requestStream.ReadByte();
|
||||
}
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return _requestStream.BeginRead(buffer, offset, count, callback, state);
|
||||
|
@ -143,7 +143,7 @@ namespace Microsoft.Net.Http.Server
|
|||
{
|
||||
_responseStream.WriteByte(value);
|
||||
}
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return _responseStream.BeginWrite(buffer, offset, count, callback, state);
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace Microsoft.Net.Http.Server
|
|||
}
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
#else
|
||||
public override unsafe IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
|
@ -293,7 +293,7 @@ namespace Microsoft.Net.Http.Server
|
|||
return asyncResult;
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public int EndRead(IAsyncResult asyncResult)
|
||||
#else
|
||||
public override int EndRead(IAsyncResult asyncResult)
|
||||
|
@ -428,7 +428,7 @@ namespace Microsoft.Net.Http.Server
|
|||
throw new InvalidOperationException(Resources.Exception_ReadOnlyStream);
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
#else
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||
|
@ -437,7 +437,7 @@ namespace Microsoft.Net.Http.Server
|
|||
throw new InvalidOperationException(Resources.Exception_ReadOnlyStream);
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public void EndWrite(IAsyncResult asyncResult)
|
||||
#else
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
|
|
|
@ -379,7 +379,7 @@ namespace Microsoft.Net.Http.Server
|
|||
throw new InvalidOperationException(Resources.Exception_WriteOnlyStream);
|
||||
}
|
||||
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
throw new InvalidOperationException(Resources.Exception_WriteOnlyStream);
|
||||
|
@ -468,7 +468,7 @@ namespace Microsoft.Net.Http.Server
|
|||
}
|
||||
}
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
#else
|
||||
public override unsafe IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
|
@ -476,7 +476,7 @@ namespace Microsoft.Net.Http.Server
|
|||
{
|
||||
return WriteAsync(buffer, offset, count).ToIAsyncResult(callback, state);
|
||||
}
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public void EndWrite(IAsyncResult asyncResult)
|
||||
#else
|
||||
public override void EndWrite(IAsyncResult asyncResult)
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Microsoft.Net.Http.Server
|
|||
var boundHandle = responseStream.RequestContext.Server.BoundHandle;
|
||||
|
||||
int bufferSize = 1024 * 64; // TODO: Validate buffer size choice.
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
_fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize /*, useAsync: true*/); // Extremely expensive.
|
||||
#else
|
||||
// It's too expensive to validate anything before opening the file. Open the file and then check the lengths.
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace Microsoft.Net.Http.Server
|
|||
: base(errorCode, message)
|
||||
{
|
||||
}
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
public int ErrorCode
|
||||
#else
|
||||
// the base class returns the HResult with this property
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//
|
||||
// ==--==
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//
|
||||
// ==--==
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
**
|
||||
=============================================================================*/
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace System.Runtime.InteropServices
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@
|
|||
"allowUnsafe": true,
|
||||
"warningsAsErrors": true,
|
||||
"keyFile": "../../tools/Key.snk",
|
||||
"nowarn": [ "CS1591" ],
|
||||
"nowarn": [
|
||||
"CS1591"
|
||||
],
|
||||
"xmlDoc": true
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {},
|
||||
"dotnet5.4": {
|
||||
"netstandard1.3": {
|
||||
"dependencies": {
|
||||
"Microsoft.Win32.Primitives": "4.0.1-*",
|
||||
"System.Diagnostics.Contracts": "4.0.1-*",
|
||||
|
@ -29,7 +31,10 @@
|
|||
"System.Security.Principal.Windows": "4.0.0-*",
|
||||
"System.Text.Encoding.Extensions": "4.0.11-*",
|
||||
"System.Threading.Overlapped": "4.0.1-*"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"dotnet5.4"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace Microsoft.Net.WebSockets
|
|||
{
|
||||
internal static class UnsafeNativeMethods
|
||||
{
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
private const string api_ms_win_core_libraryloader_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll";
|
||||
#else
|
||||
private const string KERNEL32 = "kernel32.dll";
|
||||
|
@ -40,14 +40,14 @@ namespace Microsoft.Net.WebSockets
|
|||
|
||||
internal static class SafeNetHandles
|
||||
{
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, CharSet=CharSet.Unicode, SetLastError = true)]
|
||||
#endif
|
||||
internal static extern unsafe SafeLoadLibrary LoadLibraryExW([In] string lpwLibFileName, [In] void* hFile, [In] uint dwFlags);
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
[DllImport(api_ms_win_core_libraryloader_LIB, ExactSpelling = true, SetLastError = true)]
|
||||
#else
|
||||
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
|
||||
|
@ -173,7 +173,7 @@ namespace Microsoft.Net.WebSockets
|
|||
|
||||
static WebSocketProtocolComponent()
|
||||
{
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
DllFileName = Path.Combine(Environment.GetEnvironmentVariable("SYSTEMROOT"), "System32", WEBSOCKET);
|
||||
#else
|
||||
DllFileName = Path.Combine(Environment.SystemDirectory, WEBSOCKET);
|
||||
|
|
|
@ -1103,7 +1103,7 @@ namespace Microsoft.Net.WebSockets
|
|||
|
||||
if (thisLockTaken || sessionHandleLockTaken)
|
||||
{
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
#endif
|
||||
try
|
||||
|
@ -1189,7 +1189,7 @@ namespace Microsoft.Net.WebSockets
|
|||
Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
|
||||
if (lockTaken)
|
||||
{
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
#endif
|
||||
try
|
||||
|
@ -2253,7 +2253,7 @@ namespace Microsoft.Net.WebSockets
|
|||
"'webSocket.m_KeepAliveTracker' MUST NOT be NULL at this point.");
|
||||
int keepAliveIntervalMilliseconds = (int)_keepAliveInterval.TotalMilliseconds;
|
||||
Contract.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE.");
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
_keepAliveTimer = new Timer(_keepAliveTimerElapsedCallback, webSocket, keepAliveIntervalMilliseconds, Timeout.Infinite);
|
||||
#else
|
||||
if (ExecutionContext.IsFlowSuppressed())
|
||||
|
|
|
@ -28,7 +28,7 @@ using System.Runtime.InteropServices;
|
|||
|
||||
namespace Microsoft.Net.WebSockets
|
||||
{
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
|
||||
#endif
|
||||
internal sealed class WebSocketException : Win32Exception
|
||||
|
@ -115,7 +115,7 @@ namespace Microsoft.Net.WebSockets
|
|||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
#if !DOTNET5_4
|
||||
#if !NETSTANDARD1_3
|
||||
public override int ErrorCode
|
||||
{
|
||||
get
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//
|
||||
// ==--==
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// See the Apache 2 License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
**
|
||||
=============================================================================*/
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
namespace System.Runtime.InteropServices
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// See the Apache 2 License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
#if DOTNET5_4
|
||||
#if NETSTANDARD1_3
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
"allowUnsafe": true,
|
||||
"warningsAsErrors": true,
|
||||
"keyFile": "../../tools/Key.snk",
|
||||
"nowarn": [ "CS1591" ],
|
||||
"nowarn": [
|
||||
"CS1591"
|
||||
],
|
||||
"xmlDoc": true
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {},
|
||||
"dotnet5.4": {
|
||||
"netstandard1.3": {
|
||||
"dependencies": {
|
||||
"System.Collections": "4.0.11-*",
|
||||
"System.Linq": "4.1.0-*",
|
||||
|
@ -25,7 +27,10 @@
|
|||
"System.Threading.Tasks": "4.0.11-*",
|
||||
"System.Threading.Timer": "4.0.1-*",
|
||||
"System.Threading.ThreadPool": "4.0.10-*"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"dotnet5.4"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
|
|||
Assert.Equal("Hello World", response);
|
||||
}
|
||||
}
|
||||
#if !DNXCORE50
|
||||
#if !NETSTANDARDAPP1_5
|
||||
[Fact]
|
||||
public async Task RequestBody_ReadBeginEnd_Success()
|
||||
{
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
|
|||
Assert.Equal(0, response.ContentLength);
|
||||
Assert.NotNull(response.Headers["Date"]);
|
||||
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
|
||||
#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
|
||||
#else
|
||||
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
|
||||
|
@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
|
|||
Assert.Equal(0, response.ContentLength);
|
||||
Assert.NotNull(response.Headers["Date"]);
|
||||
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
|
||||
#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
|
||||
#else
|
||||
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
|
||||
|
|
|
@ -7,14 +7,17 @@
|
|||
"xunit": "2.1.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"dependencies": {
|
||||
"System.Net.Http.WinHttpHandler": "4.0.0-*",
|
||||
"System.Net.Requests": "4.0.11-*",
|
||||
"System.Net.WebHeaderCollection": "4.0.1-*",
|
||||
"dotnet-test-xunit": "1.0.0-dev-*"
|
||||
},
|
||||
"imports": "portable-net451+win8"
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net451+win8"
|
||||
]
|
||||
},
|
||||
"net451": {
|
||||
"frameworkAssemblies": {
|
||||
|
@ -27,4 +30,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -153,7 +153,7 @@ namespace Microsoft.Net.Http.Server
|
|||
var context = await server.GetContextAsync();
|
||||
context.Response.Headers["Content-lenGth"] = " 20 ";
|
||||
context.Dispose();
|
||||
#if !DNXCORE50
|
||||
#if !NETSTANDARDAPP1_5
|
||||
// HttpClient retries the request because it didn't get a response.
|
||||
context = await server.GetContextAsync();
|
||||
context.Response.Headers["Content-lenGth"] = " 20 ";
|
||||
|
@ -175,7 +175,7 @@ namespace Microsoft.Net.Http.Server
|
|||
context.Response.Headers["Content-lenGth"] = " 20 ";
|
||||
context.Response.Body.Write(new byte[5], 0, 5);
|
||||
context.Dispose();
|
||||
#if !DNXCORE50
|
||||
#if !NETSTANDARDAPP1_5
|
||||
// HttpClient retries the request because it didn't get a response.
|
||||
context = await server.GetContextAsync();
|
||||
context.Response.Headers["Content-lenGth"] = " 20 ";
|
||||
|
@ -199,7 +199,7 @@ namespace Microsoft.Net.Http.Server
|
|||
context.Response.Body.Write(new byte[5], 0, 5);
|
||||
Assert.Throws<InvalidOperationException>(() => context.Response.Body.Write(new byte[6], 0, 6));
|
||||
context.Dispose();
|
||||
#if !DNXCORE50
|
||||
#if !NETSTANDARDAPP1_5
|
||||
// HttpClient retries the request because it didn't get a response.
|
||||
context = await server.GetContextAsync();
|
||||
context.Response.Headers["Content-lenGth"] = " 10 ";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
@ -217,7 +217,7 @@ namespace Microsoft.Net.Http.Server
|
|||
Assert.Equal(0, response.ContentLength);
|
||||
Assert.NotNull(response.Headers["Date"]);
|
||||
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
|
||||
#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
|
||||
#else
|
||||
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
|
||||
|
@ -246,7 +246,7 @@ namespace Microsoft.Net.Http.Server
|
|||
Assert.Equal(0, response.ContentLength);
|
||||
Assert.NotNull(response.Headers["Date"]);
|
||||
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
|
||||
#if DNXCORE50 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR.
|
||||
Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
|
||||
#else
|
||||
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
|
||||
|
|
|
@ -123,7 +123,7 @@ namespace Microsoft.Net.Http.Server
|
|||
context.Abort();
|
||||
Assert.True(canceled.WaitOne(interval), "Aborted");
|
||||
Assert.True(ct.IsCancellationRequested, "IsCancellationRequested");
|
||||
#if !DNXCORE50
|
||||
#if !NETSTANDARDAPP1_5
|
||||
// HttpClient re-tries the request because it doesn't know if the request was received.
|
||||
context = await server.GetContextAsync();
|
||||
context.Abort();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"xunit": "2.1.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"dependencies": {
|
||||
"System.Net.Http": "4.0.1-*",
|
||||
"System.Net.Http.WinHttpHandler": "4.0.0-*",
|
||||
|
@ -16,7 +16,10 @@
|
|||
"System.Net.WebSockets.Client": "4.0.0-*",
|
||||
"dotnet-test-xunit": "1.0.0-dev-*"
|
||||
},
|
||||
"imports": "portable-net451+win8"
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net451+win8"
|
||||
]
|
||||
},
|
||||
"net451": {
|
||||
"frameworkAssemblies": {
|
||||
|
@ -31,4 +34,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче