Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Migration #121

Merged
merged 1 commit into from
May 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ nuget.exe
*.sln.ide
project.lock.json
/.vs/
.vscode/
.build/
.testPublish/
launchSettings.json
Expand Down
2 changes: 1 addition & 1 deletion samples/ResponseCachingSample/ResponseCachingSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />

<PropertyGroup>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<Description>ASP.NET Core response caching middleware abstractions and feature interface definitions.</Description>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;cache;caching</PackageTags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<Description>ASP.NET Core middleware for caching HTTP responses on the server.</Description>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,12 @@ public override void WriteByte(byte value)
}
}

#if NETSTANDARD1_3
public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? Wouldn't you want this code and not the other one? This branch was the one used by the netstandard build (which was actually the only build anyway)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need to override Begin/End stream methods. These were not in early standards.

#else
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#endif
{
return StreamUtilities.ToIAsyncResult(WriteAsync(buffer, offset, count), callback, state);
}
#if NETSTANDARD1_3
public void EndWrite(IAsyncResult asyncResult)
#else

public override void EndWrite(IAsyncResult asyncResult)
#endif
{
if (asyncResult == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ public override int ReadByte()
return byteRead;
}

#if NETSTANDARD1_3
public IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#else
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#endif
{
var tcs = new TaskCompletionSource<int>(state);

Expand Down Expand Up @@ -176,11 +172,7 @@ public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, Asy
return tcs.Task;
}

#if NETSTANDARD1_3
public int EndRead(IAsyncResult asyncResult)
#else
public override int EndRead(IAsyncResult asyncResult)
#endif
{
if (asyncResult == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,12 @@ public override void WriteByte(byte value)
_length++;
}

#if NETSTANDARD1_3
public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#else
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#endif
{
return StreamUtilities.ToIAsyncResult(WriteAsync(buffer, offset, count), callback, state);
}

#if NETSTANDARD1_3
public void EndWrite(IAsyncResult asyncResult)
#else
public override void EndWrite(IAsyncResult asyncResult)
#endif
{
if (asyncResult == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
Expand Down