Skip to content

.Net 5.0 support #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/dotnet/core/sdk:3.1
FROM mcr.microsoft.com/dotnet/sdk:5.0

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/dotnetcore-3.1
{
"name": "C# (.NET Core 3.1)",
"name": "FollowingFileStream dev (.NET 5.0)",
"dockerFile": "Dockerfile",

// Set *default* container specific settings.json values on container create.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.0;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.0;netcoreapp2.2</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<nullable>enable</nullable>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion FollowingFileStream.Tests/FollowingFileStream.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.0;netcoreapp2.2</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<nullable>enable</nullable>
<IsPackable>false</IsPackable>
Expand Down
4 changes: 2 additions & 2 deletions FollowingFileStream/AsyncStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static AsyncStream Synchronized(AsyncStream stream)
/// <exception cref="System.IO.IOException">
/// An asynchronous read was attempted past the end of the file.
/// </exception>
public sealed override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
public sealed override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
{
return ApmAsyncFactory.ToBegin(
this.ReadAsync(buffer, offset, count, CancellationToken.None),
Expand Down Expand Up @@ -110,7 +110,7 @@ public sealed override IAsyncResult BeginRead(byte[] buffer, int offset, int cou
/// <exception cref="System.IO.IOException">
/// An asynchronous write was attempted past the end of the file.
/// </exception>
public sealed override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
public sealed override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
{
return ApmAsyncFactory.ToBegin(
this.WriteAsync(buffer, offset, count, CancellationToken.None),
Expand Down
2 changes: 1 addition & 1 deletion FollowingFileStream/FollowingFileStream.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.1;netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.1;netstandard2.0;netstandard1.3</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<nullable>enable</nullable>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
18 changes: 15 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ jobs:
inputs:
version: 3.x

- task: UseDotNet@2
displayName: 'Use dotnet sdk 5.x'
inputs:
version: 5.x
includePreviewVersions: true

- task: GitVersion@5
inputs:
runtime: 'core'
Expand All @@ -45,7 +51,7 @@ jobs:
scannerMode: 'MSBuild'
projectKey: 'manandre_FollowingFileStream'
projectVersion: '$(Build.BuildId)'
extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml'
extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.net5.0.opencover.xml'

- task: DotNetCoreCLI@2
displayName: Restore
Expand Down Expand Up @@ -80,13 +86,13 @@ jobs:

- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.net5.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Run Reportgenerator on Linux

- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
.\reportgenerator.exe "-reports:$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
.\reportgenerator.exe "-reports:$(Build.SourcesDirectory)/coverage/coverage.net5.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Run Reportgenerator on Windows

Expand Down Expand Up @@ -179,6 +185,12 @@ jobs:
inputs:
version: 3.x

- task: UseDotNet@2
displayName: 'Use dotnet sdk 5.x'
inputs:
version: 5.x
includePreviewVersions: true

# First restore to resolve external dependencies
- task: DotNetCoreCLI@2
displayName: Restore
Expand Down