Skip to content

Commit 5ac9883

Browse files
committed
Update repo for .NET 9
1 parent 5e6821c commit 5ac9883

File tree

99 files changed

+163
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+163
-146
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
env:
1212
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1313

14+
permissions:
15+
contents: read
16+
actions: read
17+
checks: write
18+
1419
jobs:
1520

1621
build:
@@ -26,6 +31,11 @@ jobs:
2631

2732
- name: Build and run tests
2833
run: ./build_and_test.sh
34+
35+
- uses: actions/upload-artifact@v4
36+
with:
37+
name: artifacts
38+
path: artifacts
2939

3040
grpc_web:
3141
name: gRPC-Web Tests

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<LangVersion>12.0</LangVersion>
2525
<Nullable>enable</Nullable>
2626
<ImplicitUsings>enable</ImplicitUsings>
27+
28+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
2729
</PropertyGroup>
2830

2931
</Project>

Directory.Packages.props

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<MicrosoftAspNetCoreAppPackageVersion>8.0.0</MicrosoftAspNetCoreAppPackageVersion>
4+
<MicrosoftAspNetCoreAppPackageVersion>9.0.0-preview.4.24267.6</MicrosoftAspNetCoreAppPackageVersion>
5+
<MicrosoftAspNetCoreApp8PackageVersion>8.0.6</MicrosoftAspNetCoreApp8PackageVersion>
56
<MicrosoftAspNetCoreApp7PackageVersion>7.0.5</MicrosoftAspNetCoreApp7PackageVersion>
67
<MicrosoftAspNetCoreApp6PackageVersion>6.0.11</MicrosoftAspNetCoreApp6PackageVersion>
7-
<GrpcDotNetPackageVersion>2.58.0</GrpcDotNetPackageVersion>
8+
<GrpcDotNetPackageVersion>2.63.0</GrpcDotNetPackageVersion>
89
<OpenTelemetryPackageVersion>1.6.0</OpenTelemetryPackageVersion>
910
<OpenTelemetryIntergationPackageVersion>1.8.1</OpenTelemetryIntergationPackageVersion>
1011
<OpenTelemetryGrpcPackageVersion>1.8.0-beta.1</OpenTelemetryGrpcPackageVersion>
11-
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion>
12+
<MicrosoftExtensionsPackageVersion>9.0.0-preview.4.24266.19</MicrosoftExtensionsPackageVersion>
1213
<MicrosoftExtensionsLtsPackageVersion>6.0.0</MicrosoftExtensionsLtsPackageVersion>
1314
</PropertyGroup>
1415
<ItemGroup>
@@ -64,7 +65,7 @@
6465
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
6566
<PackageVersion Include="Microsoft.Build.Locator" Version="1.5.5" />
6667
<PackageVersion Include="Microsoft.Build" Version="16.9.0" />
67-
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
68+
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24216.2" />
6869
<PackageVersion Include="Microsoft.Crank.EventSources" Version="0.2.0-alpha.21255.1" />
6970
<PackageVersion Include="Microsoft.Extensions.Logging.Testing" Version="2.1.1" />
7071
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />

build/get-dotnet.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ echo "Downloading install script: $install_script_url => $install_script_path"
2727
curl -sSL -o $install_script_path $install_script_url
2828
chmod +x $install_script_path
2929

30-
# Install .NET Core 3.x SDK to run 3.x test targets
31-
$install_script_path -v 3.1.300 -i $dotnet_install_path
32-
33-
# Install .NET 5 SDK to run 5.0 test targets
34-
$install_script_path -v 5.0.302 -i $dotnet_install_path
35-
3630
# Install .NET 6 SDK to run 6.0 test targets
37-
$install_script_path -v 6.0.202 -i $dotnet_install_path
31+
$install_script_path -v 6.0.423 -i $dotnet_install_path
3832

3933
# Install .NET 7 SDK to run 7.0 test targets
40-
$install_script_path -v 7.0.100 -i $dotnet_install_path
34+
$install_script_path -v 7.0.410 -i $dotnet_install_path
35+
36+
# Install .NET 8 SDK to run 8.0 test targets
37+
$install_script_path -v 8.0.301 -i $dotnet_install_path
4138

4239
# Install .NET version specified by global.json
4340
$install_script_path -v $sdk_version -i $dotnet_install_path

build_and_test.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,39 @@ echo "Building solution"
2222
dotnet build -c Release
2323

2424
echo "Building examples"
25-
2625
example_solutions=( $( ls examples/**/*.sln ) )
27-
2826
for example_solution in "${example_solutions[@]}"
2927
do
3028
dotnet build $example_solution -c Release
3129
done
3230

3331
echo "Testing solution"
34-
32+
has_errors=false
3533
test_projects=( $( ls test/**/*Tests.csproj ) )
36-
3734
for test_project in "${test_projects[@]}"
3835
do
36+
base_name=$(basename ${test_project%.*})
3937
# https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345
40-
dotnet test $test_project -c Release -v n --no-build -- NUnit.ConsoleOut=0 < /dev/null
38+
dotnet test $test_project -c Release --no-build --logger "trx;LogFilePrefix=$base_name" --results-directory artifacts/test-results -- NUnit.ConsoleOut=0 < /dev/null || exit_status=$?
39+
if [ exit_status -eq 0 ]
40+
then
41+
echo "Tests passed"
42+
else
43+
has_errors=true
44+
echo "Test failures"
45+
fi
4146
done
4247

43-
echo "Tests finished"
48+
echo "Printing test results"
49+
test_results=( $( ls artifacts/test-results/*.trx ) )
50+
for test_result in "${test_results[@]}"
51+
do
52+
echo "Test result: $test_result"
53+
done
54+
55+
echo "Tests finished"
56+
57+
if [ has_errors = true ]
58+
then
59+
exit 1
60+
fi

examples/Aggregator/Client/Client.csproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

examples/Aggregator/Server/Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

examples/Blazor/Client/Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

examples/Blazor/Server/Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<UserSecretsId>46982f83-f153-443e-b589-4b2bc7b5945e</UserSecretsId>
66
</PropertyGroup>
77

examples/Browser/Server/Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<SpaRoot>wwwroot\</SpaRoot>
66
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(SpaRoot)dist\**</DefaultItemExcludes>
77
</PropertyGroup>

0 commit comments

Comments
 (0)