Remove net451 as a cross-compile target
This commit is contained in:
parent
49daa416ba
commit
b3b846c27e
|
|
@ -28,3 +28,4 @@ project.lock.json
|
||||||
.build/
|
.build/
|
||||||
.testPublish/
|
.testPublish/
|
||||||
/.vs/
|
/.vs/
|
||||||
|
global.json
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\dependencies.props" />
|
<Import Project="..\..\build\dependencies.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Microsoft.AspNetCore.Builder.IApplicationBuilder
|
||||||
Microsoft.AspNetCore.Http.HttpContext
|
Microsoft.AspNetCore.Http.HttpContext
|
||||||
Microsoft.AspNetCore.Http.HttpRequest
|
Microsoft.AspNetCore.Http.HttpRequest
|
||||||
Microsoft.AspNetCore.Http.HttpResponse</Description>
|
Microsoft.AspNetCore.Http.HttpResponse</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFramework>netstandard1.3</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore</PackageTags>
|
<PackageTags>aspnetcore</PackageTags>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core common extension methods for HTTP abstractions, HTTP headers, HTTP request/response, and session state.</Description>
|
<Description>ASP.NET Core common extension methods for HTTP abstractions, HTTP headers, HTTP request/response, and session state.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFramework>netstandard1.3</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore</PackageTags>
|
<PackageTags>aspnetcore</PackageTags>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core HTTP feature interface definitions.</Description>
|
<Description>ASP.NET Core HTTP feature interface definitions.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFramework>netstandard1.3</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore</PackageTags>
|
<PackageTags>aspnetcore</PackageTags>
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,8 @@ namespace Microsoft.AspNetCore.Http
|
||||||
public class FormCollection : IFormCollection
|
public class FormCollection : IFormCollection
|
||||||
{
|
{
|
||||||
public static readonly FormCollection Empty = new FormCollection();
|
public static readonly FormCollection Empty = new FormCollection();
|
||||||
#if NETSTANDARD1_3
|
|
||||||
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
||||||
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
||||||
#else
|
|
||||||
private static readonly string[] EmptyKeys = new string[0];
|
|
||||||
private static readonly StringValues[] EmptyValues = new StringValues[0];
|
|
||||||
#endif
|
|
||||||
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
||||||
// Pre-box
|
// Pre-box
|
||||||
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,8 @@ namespace Microsoft.AspNetCore.Http
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class HeaderDictionary : IHeaderDictionary
|
public class HeaderDictionary : IHeaderDictionary
|
||||||
{
|
{
|
||||||
#if NETSTANDARD1_3
|
|
||||||
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
||||||
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
||||||
#else
|
|
||||||
private static readonly string[] EmptyKeys = new string[0];
|
|
||||||
private static readonly StringValues[] EmptyValues = new StringValues[0];
|
|
||||||
#endif
|
|
||||||
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
||||||
// Pre-box
|
// Pre-box
|
||||||
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,12 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NET451
|
|
||||||
using System;
|
|
||||||
using System.Runtime.Remoting;
|
|
||||||
using System.Runtime.Remoting.Messaging;
|
|
||||||
#elif NETSTANDARD1_3
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Http
|
namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
public class HttpContextAccessor : IHttpContextAccessor
|
public class HttpContextAccessor : IHttpContextAccessor
|
||||||
{
|
{
|
||||||
#if NET451
|
|
||||||
private static readonly string LogicalDataKey = "__HttpContext_Current__" + AppDomain.CurrentDomain.Id;
|
|
||||||
|
|
||||||
public HttpContext HttpContext
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var handle = CallContext.LogicalGetData(LogicalDataKey) as ObjectHandle;
|
|
||||||
return handle?.Unwrap() as HttpContext;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
CallContext.LogicalSetData(LogicalDataKey, new ObjectHandle(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif NETSTANDARD1_3
|
|
||||||
private static AsyncLocal<HttpContext> _httpContextCurrent = new AsyncLocal<HttpContext>();
|
private static AsyncLocal<HttpContext> _httpContextCurrent = new AsyncLocal<HttpContext>();
|
||||||
|
|
||||||
public HttpContext HttpContext
|
public HttpContext HttpContext
|
||||||
|
|
@ -43,6 +20,5 @@ namespace Microsoft.AspNetCore.Http
|
||||||
_httpContextCurrent.Value = value;
|
_httpContextCurrent.Value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,8 @@ namespace Microsoft.AspNetCore.Http.Internal
|
||||||
public class QueryCollection : IQueryCollection
|
public class QueryCollection : IQueryCollection
|
||||||
{
|
{
|
||||||
public static readonly QueryCollection Empty = new QueryCollection();
|
public static readonly QueryCollection Empty = new QueryCollection();
|
||||||
#if NETSTANDARD1_3
|
|
||||||
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
||||||
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
|
||||||
#else
|
|
||||||
private static readonly string[] EmptyKeys = new string[0];
|
|
||||||
private static readonly StringValues[] EmptyValues = new StringValues[0];
|
|
||||||
#endif
|
|
||||||
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
||||||
// Pre-box
|
// Pre-box
|
||||||
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Http.Internal
|
||||||
_position += read;
|
_position += read;
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
#if NET451
|
#if NET46
|
||||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
{
|
{
|
||||||
ThrowIfDisposed();
|
ThrowIfDisposed();
|
||||||
|
|
@ -164,16 +164,6 @@ namespace Microsoft.AspNetCore.Http.Internal
|
||||||
var task = (Task<int>)asyncResult;
|
var task = (Task<int>)asyncResult;
|
||||||
return task.GetAwaiter().GetResult();
|
return task.GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
public override void Write(byte[] buffer, int offset, int count)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
#if NET451
|
|
||||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
@ -183,7 +173,19 @@ namespace Microsoft.AspNetCore.Http.Internal
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
#elif NETSTANDARD1_3
|
||||||
|
#else
|
||||||
|
#error Target frameworks need to be updated.
|
||||||
#endif
|
#endif
|
||||||
|
public override void Write(byte[] buffer, int offset, int count)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
public override void SetLength(long value)
|
public override void SetLength(long value)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,7 @@ namespace Microsoft.AspNetCore.Http.Internal
|
||||||
public class RequestCookieCollection : IRequestCookieCollection
|
public class RequestCookieCollection : IRequestCookieCollection
|
||||||
{
|
{
|
||||||
public static readonly RequestCookieCollection Empty = new RequestCookieCollection();
|
public static readonly RequestCookieCollection Empty = new RequestCookieCollection();
|
||||||
#if NETSTANDARD1_3
|
|
||||||
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
private static readonly string[] EmptyKeys = Array.Empty<string>();
|
||||||
#else
|
|
||||||
private static readonly string[] EmptyKeys = new string[0];
|
|
||||||
#endif
|
|
||||||
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
private static readonly Enumerator EmptyEnumerator = new Enumerator();
|
||||||
// Pre-box
|
// Pre-box
|
||||||
private static readonly IEnumerator<KeyValuePair<string, string>> EmptyIEnumeratorType = EmptyEnumerator;
|
private static readonly IEnumerator<KeyValuePair<string, string>> EmptyIEnumeratorType = EmptyEnumerator;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core default HTTP feature implementations.</Description>
|
<Description>ASP.NET Core default HTTP feature implementations.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core component for running OWIN middleware in an ASP.NET Core application, and to run ASP.NET Core middleware in an OWIN application.</Description>
|
<Description>ASP.NET Core component for running OWIN middleware in an ASP.NET Core application, and to run ASP.NET Core middleware in an OWIN application.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFramework>netstandard1.3</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;owin</PackageTags>
|
<PackageTags>aspnetcore;owin</PackageTags>
|
||||||
|
|
|
||||||
|
|
@ -162,17 +162,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
{
|
{
|
||||||
_inner.Write(buffer, offset, count);
|
_inner.Write(buffer, offset, count);
|
||||||
}
|
}
|
||||||
#if NET451
|
|
||||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
|
||||||
{
|
|
||||||
return _inner.BeginWrite(buffer, offset, count, callback, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void EndWrite(IAsyncResult asyncResult)
|
|
||||||
{
|
|
||||||
_inner.EndWrite(asyncResult);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
return _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
||||||
|
|
@ -211,7 +201,17 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
|
|
||||||
return await _inner.ReadAsync(buffer, offset, count, cancellationToken);
|
return await _inner.ReadAsync(buffer, offset, count, cancellationToken);
|
||||||
}
|
}
|
||||||
#if NET451
|
#if NET46
|
||||||
|
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
|
{
|
||||||
|
return _inner.BeginWrite(buffer, offset, count, callback, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndWrite(IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
_inner.EndWrite(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
// We only anticipate using ReadAsync
|
// We only anticipate using ReadAsync
|
||||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
{
|
{
|
||||||
|
|
@ -262,6 +262,9 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
}
|
}
|
||||||
return _inner.EndRead(asyncResult);
|
return _inner.EndRead(asyncResult);
|
||||||
}
|
}
|
||||||
|
#elif NETSTANDARD1_3
|
||||||
|
#else
|
||||||
|
#error Target frameworks need to be updated.
|
||||||
#endif
|
#endif
|
||||||
public bool EnsureBuffered()
|
public bool EnsureBuffered()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
|
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
#if NET451
|
#if NET46
|
||||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
{
|
{
|
||||||
ThrowIfDisposed();
|
ThrowIfDisposed();
|
||||||
|
|
@ -298,6 +298,19 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
var task = (Task<int>)asyncResult;
|
var task = (Task<int>)asyncResult;
|
||||||
return task.GetAwaiter().GetResult();
|
return task.GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndWrite(IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
#elif NETSTANDARD1_3
|
||||||
|
#else
|
||||||
|
#error Target frameworks need to be updated.
|
||||||
#endif
|
#endif
|
||||||
public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
@ -358,17 +371,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
#if NET451
|
|
||||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void EndWrite(IAsyncResult asyncResult)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
|
||||||
|
|
@ -108,11 +108,14 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET451
|
#if NET46
|
||||||
public override void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
}
|
}
|
||||||
|
#elif NETSTANDARD1_3
|
||||||
|
#else
|
||||||
|
#error Target frameworks need to be updated.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core utilities, such as for working with forms, multipart messages, and query strings.</Description>
|
<Description>ASP.NET Core utilities, such as for working with forms, multipart messages, and query strings.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
|
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
|
||||||
<DefineConstants>$(DefineConstants);WebEncoders_In_WebUtilities</DefineConstants>
|
<DefineConstants>$(DefineConstants);WebEncoders_In_WebUtilities</DefineConstants>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
|
|
||||||
|
|
@ -126,17 +126,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
#if NET451
|
|
||||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void EndWrite(IAsyncResult asyncResult)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
@ -168,7 +158,17 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
}
|
}
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
#if NET451
|
#if NET46
|
||||||
|
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndWrite(IAsyncResult asyncResult)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
public override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
|
||||||
{
|
{
|
||||||
var tcs = new TaskCompletionSource<int>(state);
|
var tcs = new TaskCompletionSource<int>(state);
|
||||||
|
|
@ -215,6 +215,9 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
var task = (Task<int>)asyncResult;
|
var task = (Task<int>)asyncResult;
|
||||||
return task.GetAwaiter().GetResult();
|
return task.GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
#elif NETSTANDARD1_3
|
||||||
|
#else
|
||||||
|
#error Target frameworks need to be updated.
|
||||||
#endif
|
#endif
|
||||||
public override int Read(byte[] buffer, int offset, int count)
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
|
|
@ -231,10 +234,8 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
var bufferedData = _innerStream.BufferedData;
|
var bufferedData = _innerStream.BufferedData;
|
||||||
|
|
||||||
// scan for a boundary match, full or partial.
|
// scan for a boundary match, full or partial.
|
||||||
int matchOffset;
|
|
||||||
int matchCount;
|
|
||||||
int read;
|
int read;
|
||||||
if (SubMatch(bufferedData, _boundary.BoundaryBytes, out matchOffset, out matchCount))
|
if (SubMatch(bufferedData, _boundary.BoundaryBytes, out var matchOffset, out var matchCount))
|
||||||
{
|
{
|
||||||
// We found a possible match, return any data before it.
|
// We found a possible match, return any data before it.
|
||||||
if (matchOffset > bufferedData.Offset)
|
if (matchOffset > bufferedData.Offset)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>HTTP header parser implementations.</Description>
|
<Description>HTTP header parser implementations.</Description>
|
||||||
<TargetFrameworks>net451;netstandard1.1</TargetFrameworks>
|
<TargetFramework>netstandard1.1</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.Extensions.ObjectPool;
|
using Microsoft.Extensions.ObjectPool;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
@ -36,7 +37,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
contextFactory.Dispose(context);
|
contextFactory.Dispose(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET452
|
#if NET46
|
||||||
private static void DomainFunc()
|
private static void DomainFunc()
|
||||||
{
|
{
|
||||||
var accessor = new HttpContextAccessor();
|
var accessor = new HttpContextAccessor();
|
||||||
|
|
@ -50,9 +51,11 @@ namespace Microsoft.AspNetCore.Http
|
||||||
// Arrange
|
// Arrange
|
||||||
var accessor = new HttpContextAccessor();
|
var accessor = new HttpContextAccessor();
|
||||||
var contextFactory = new HttpContextFactory(new DefaultObjectPoolProvider(), Options.Create(new FormOptions()), accessor);
|
var contextFactory = new HttpContextFactory(new DefaultObjectPoolProvider(), Options.Create(new FormOptions()), accessor);
|
||||||
|
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
var setupInfo = new AppDomainSetup
|
var setupInfo = new AppDomainSetup
|
||||||
{
|
{
|
||||||
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory
|
ApplicationBase = baseDirectory,
|
||||||
|
ConfigurationFile = Path.Combine(baseDirectory, Path.GetFileNameWithoutExtension(GetType().Assembly.Location) + ".dll.config"),
|
||||||
};
|
};
|
||||||
var domain = AppDomain.CreateDomain("newDomain", null, setupInfo);
|
var domain = AppDomain.CreateDomain("newDomain", null, setupInfo);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ namespace Microsoft.AspNetCore.WebUtilities
|
||||||
|
|
||||||
private static string GetCurrentDirectory()
|
private static string GetCurrentDirectory()
|
||||||
{
|
{
|
||||||
#if NET452
|
#if NET46
|
||||||
return AppDomain.CurrentDomain.BaseDirectory;
|
return AppDomain.CurrentDomain.BaseDirectory;
|
||||||
#elif NETCOREAPP2_0
|
#elif NETCOREAPP2_0
|
||||||
return AppContext.BaseDirectory;
|
return AppContext.BaseDirectory;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
Assert.Equal(expectedData, memoryStream.ToArray());
|
Assert.Equal(expectedData, memoryStream.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET452
|
#if NET46
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task DoesNotFlush_UnderlyingStream_OnClosingWriter()
|
public async Task DoesNotFlush_UnderlyingStream_OnClosingWriter()
|
||||||
{
|
{
|
||||||
|
|
@ -71,7 +71,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
Assert.Equal(0, stream.FlushAsyncCallCount);
|
Assert.Equal(0, stream.FlushAsyncCallCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET452
|
#if NET46
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task DoesNotClose_UnderlyingStream_OnDisposingWriter()
|
public async Task DoesNotClose_UnderlyingStream_OnDisposingWriter()
|
||||||
{
|
{
|
||||||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
await writer.WriteAsync(new string('a', byteLength));
|
await writer.WriteAsync(new string('a', byteLength));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
#if NET452
|
#if NET46
|
||||||
writer.Close();
|
writer.Close();
|
||||||
#elif NETCOREAPP2_0
|
#elif NETCOREAPP2_0
|
||||||
writer.Dispose();
|
writer.Dispose();
|
||||||
|
|
@ -345,7 +345,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("你好世界", "utf-16")]
|
[InlineData("你好世界", "utf-16")]
|
||||||
#if NET452
|
#if NET46
|
||||||
// CoreCLR does not like shift_jis as an encoding.
|
// CoreCLR does not like shift_jis as an encoding.
|
||||||
[InlineData("こんにちは世界", "shift_jis")]
|
[InlineData("こんにちは世界", "shift_jis")]
|
||||||
#elif NETCOREAPP2_0
|
#elif NETCOREAPP2_0
|
||||||
|
|
@ -379,7 +379,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
[InlineData('你', 1023, "utf-16")]
|
[InlineData('你', 1023, "utf-16")]
|
||||||
[InlineData('你', 1024, "utf-16")]
|
[InlineData('你', 1024, "utf-16")]
|
||||||
[InlineData('你', 1050, "utf-16")]
|
[InlineData('你', 1050, "utf-16")]
|
||||||
#if NET452
|
#if NET46
|
||||||
// CoreCLR does not like shift_jis as an encoding.
|
// CoreCLR does not like shift_jis as an encoding.
|
||||||
[InlineData('こ', 1023, "shift_jis")]
|
[InlineData('こ', 1023, "shift_jis")]
|
||||||
[InlineData('こ', 1024, "shift_jis")]
|
[InlineData('こ', 1024, "shift_jis")]
|
||||||
|
|
@ -516,7 +516,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
||||||
return base.WriteAsync(buffer, offset, count, cancellationToken);
|
return base.WriteAsync(buffer, offset, count, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET452
|
#if NET46
|
||||||
public override void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
CloseCallCount++;
|
CloseCallCount++;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue