Skip to content

Commit 4df2d8a

Browse files
committed
docs: Upgrade samples to .NET Core 3.1
1 parent 4bdac7e commit 4df2d8a

File tree

25 files changed

+31
-41
lines changed

25 files changed

+31
-41
lines changed

docs/samples/Directory.Build.props

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
2-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
3-
42
<PropertyGroup>
5-
<!-- Set samples to use the latest stable C# until C# 8 is released -->
6-
<LangVersion>7.3</LangVersion>
7-
<Nullable />
3+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
84
</PropertyGroup>
95

106
</Project>

docs/samples/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<ItemGroup Condition="'$(UsePackage)' != 'true'">
3+
<ItemGroup>
44
<PackageReference Remove="McMaster.Extensions.CommandLineUtils" />
55
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\src\CommandLineUtils\*.csproj" />
66
</ItemGroup>

docs/samples/attributes/Attributes.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
6-
<LangVersion>7.1</LangVersion>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
76
</PropertyGroup>
87

98
<ItemGroup>

docs/samples/custom-attribute/CustomAttribute.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
6-
<LangVersion>7.1</LangVersion>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
76
</PropertyGroup>
87

98
<ItemGroup>

docs/samples/custom-conventions/CustomConvention.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
6-
<LangVersion>7.1</LangVersion>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
76
</PropertyGroup>
87

98
<ItemGroup>

docs/samples/dependency-injection/custom/CustomServices.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.0.0" />
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" />
1111
</ItemGroup>
1212

1313
</Project>

docs/samples/dependency-injection/generic-host/GenericHostDI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.1" />
10-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
9+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.3" />
10+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.3" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

docs/samples/dependency-injection/standard/StandardServices.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.0</TargetFramework>
6-
<LangVersion>7.1</LangVersion>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
76
</PropertyGroup>
87

98
<ItemGroup>

docs/samples/generic-host/AttributeApi/AttributeApi.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="2.1.1" />
9+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.3" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

docs/samples/generic-host/AttributeApi/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ static Task<int> Main(string[] args)
1212
[Option]
1313
public int Port { get; } = 8080;
1414

15-
private IHostingEnvironment _env;
15+
private IHostEnvironment _env;
1616

17-
public Program(IHostingEnvironment env)
17+
public Program(IHostEnvironment env)
1818
{
1919
_env = env;
2020
}

0 commit comments

Comments
 (0)