Skip to content

Commit

Permalink
Add target for .NET Standard 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
brantburnett committed Apr 14, 2019
1 parent 86fc159 commit 4e97a7c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions Microsoft.IO.RecyclableMemoryStream.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.IO.RecyclableMemoryStream", "src\Microsoft.IO.RecyclableMemoryStream.csproj", "{4B52F0CE-5F4C-43E7-A054-50CA0A502CF3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.IO.RecyclableMemoryStream", "src\Microsoft.IO.RecyclableMemoryStream.csproj", "{4B52F0CE-5F4C-43E7-A054-50CA0A502CF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{419C9F3D-71CC-4F95-8324-E15CD0D1E754}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests", "UnitTests\UnitTests.csproj", "{419C9F3D-71CC-4F95-8324-E15CD0D1E754}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DF4A161A-7C52-46A2-A0ED-427C1C6F29AA}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
LICENSE = LICENSE
README.md = README.md
EndProjectSection
Expand All @@ -31,4 +32,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D5E147AF-721B-469D-AD77-A00A290340AC}
EndGlobalSection
EndGlobal
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "3.0.100-preview3-010431"
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.IO.RecyclableMemoryStream.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net40;net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netstandard1.4;netstandard2.1;net40;net45;netcoreapp2.1</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<!-- for assembly signing we use a magic variable coupled with a special build definition which skips UTs -->
Expand Down
6 changes: 3 additions & 3 deletions src/RecyclableMemoryStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public int SafeRead(byte[] buffer, int offset, int count, ref int streamPosition
return amountRead;
}

#if NETCOREAPP2_1
#if NETCOREAPP2_1 || NETSTANDARD2_1
/// <summary>
/// Reads from the current position into the provided buffer
/// </summary>
Expand Down Expand Up @@ -640,7 +640,7 @@ public override void Write(byte[] buffer, int offset, int count)
this.length = Math.Max(this.position, this.length);
}

#if NETCOREAPP2_1
#if NETCOREAPP2_1 || NETSTANDARD2_1
/// <summary>
/// Writes the buffer to the stream
/// </summary>
Expand Down Expand Up @@ -898,7 +898,7 @@ private int InternalRead(byte[] buffer, int offset, int count, int fromPosition)
return amountToCopy;
}

#if NETCOREAPP2_1
#if NETCOREAPP2_1 || NETSTANDARD2_1
private int InternalRead(Span<byte> buffer, int fromPosition)
{
if (this.length - fromPosition <= 0)
Expand Down

0 comments on commit 4e97a7c

Please sign in to comment.