Skip to content
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

Update to use .NET 8 #2021

Merged
merged 31 commits into from
Aug 15, 2023
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
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>

<!-- Ignore warning about lowercase identifiers. Caused by generated source from Protobuf. -->
<!-- TODO(JamesNK): Remove when Protobuf is updated and samples use a version of Grpc.AspNetCore that brings in Grpc.Tools 2.49.0 or later. -->
<NoWarn>$(NoWarn);CS8981</NoWarn>
<!-- Disable warnings about AOT and trimming features on older targets, e.g. netstandard2.0.
For now, continue to apply these features to these targets because some packages don't have a target that supports them -->
<NoWarn>$(NoWarn);NETSDK1195;NETSDK1210</NoWarn>

<EmbedUntrackedSources>true</EmbedUntrackedSources>
<LangVersion>11.0</LangVersion>
Expand Down
21 changes: 10 additions & 11 deletions build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
<BenchmarkDotNetPackageVersion>0.13.1</BenchmarkDotNetPackageVersion>
<GoogleApisAuthPackageVersion>1.46.0</GoogleApisAuthPackageVersion>
<GoogleProtobufPackageVersion>3.23.1</GoogleProtobufPackageVersion>
<GrpcDotNetPackageVersion>2.52.0</GrpcDotNetPackageVersion> <!-- Used by example projects -->
<GrpcDotNetPackageVersion>2.55.0</GrpcDotNetPackageVersion> <!-- Used by example projects -->
<GrpcPackageVersion>2.46.6</GrpcPackageVersion>
<GrpcToolsPackageVersion>2.56.0</GrpcToolsPackageVersion>
<MicrosoftAspNetCoreAppPackageVersion>7.0.0</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftAspNetCoreAppPackageVersion>8.0.0-rc.1.23378.7</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftAspNetCoreApp7PackageVersion>7.0.5</MicrosoftAspNetCoreApp7PackageVersion>
<MicrosoftAspNetCoreApp6PackageVersion>6.0.11</MicrosoftAspNetCoreApp6PackageVersion>
<MicrosoftAspNetCoreApp5PackageVersion>5.0.3</MicrosoftAspNetCoreApp5PackageVersion>
<MicrosoftAspNetCoreApp31PackageVersion>3.1.3</MicrosoftAspNetCoreApp31PackageVersion>
<MicrosoftBuildLocatorPackageVersion>1.5.5</MicrosoftBuildLocatorPackageVersion>
<MicrosoftBuildPackageVersion>16.9.0</MicrosoftBuildPackageVersion>
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>7.0.1-preview1.23061.1</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>8.0.0-preview1.23165.1</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
<MicrosoftCrankEventSourcesPackageVersion>0.2.0-alpha.21255.1</MicrosoftCrankEventSourcesPackageVersion>
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.1</MicrosoftExtensionsLoggingTestingPackageVersion>
<MicrosoftExtensionsPackageVersion>7.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensions3PackageVersion>3.0.3</MicrosoftExtensions3PackageVersion>
<MicrosoftNETTestSdkPackageVersion>16.9.1</MicrosoftNETTestSdkPackageVersion>
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0</MicrosoftSourceLinkGitHubPackageVersion>
<MicrosoftExtensionsPackageVersion>8.0.0-rc.1.23379.1</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensions6PackageVersion>6.0.0</MicrosoftExtensions6PackageVersion>
<MicrosoftNETTestSdkPackageVersion>17.6.2</MicrosoftNETTestSdkPackageVersion>
<MicrosoftSourceLinkGitHubPackageVersion>1.1.1</MicrosoftSourceLinkGitHubPackageVersion>
<MicrosoftWin32RegistryLinePackageVersion>4.6.0</MicrosoftWin32RegistryLinePackageVersion>
<MoqPackageVersion>4.16.1</MoqPackageVersion>
<NewtonsoftJsonPackageVersion>13.0.3</NewtonsoftJsonPackageVersion>
<NunitPackageVersion>3.13.1</NunitPackageVersion>
<Nunit3TestAdapterPackageVersion>3.16.1</Nunit3TestAdapterPackageVersion>
<NunitPackageVersion>3.13.3</NunitPackageVersion>
<Nunit3TestAdapterPackageVersion>4.5.0</Nunit3TestAdapterPackageVersion>
<OpenTelemetryPackageVersion>1.3.0</OpenTelemetryPackageVersion>
<OpenTelemetryIntergationPackageVersion>1.0.0-rc9.4</OpenTelemetryIntergationPackageVersion>
<ProtobufNetGrpcPackageVersion>1.0.140</ProtobufNetGrpcPackageVersion>
Expand Down
5 changes: 4 additions & 1 deletion build/get-dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ensure_dir() {
# main

# resolve SDK version
sdk_version=$(jq -r .sdk.version $global_json_path)
sdk_version="8.0.100-rc.1.23407.2"

# download dotnet-install.sh
ensure_dir $OBJDIR
Expand All @@ -36,5 +36,8 @@ $install_script_path -v 5.0.302 -i $dotnet_install_path
# Install .NET 6 SDK to run 6.0 test targets
$install_script_path -v 6.0.202 -i $dotnet_install_path

# Install .NET 7 SDK to run 7.0 test targets
$install_script_path -v 7.0.100 -i $dotnet_install_path

# Install .NET version specified by global.json
$install_script_path -v $sdk_version -i $dotnet_install_path
2 changes: 1 addition & 1 deletion build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test_projects=( $( ls test/**/*Tests.csproj ) )
for test_project in "${test_projects[@]}"
do
# https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345
dotnet test $test_project -c Release -v n --no-build < /dev/null
dotnet test $test_project -c Release -v n --no-build -- NUnit.ConsoleOut=0 < /dev/null
done

echo "Tests finished"
2 changes: 1 addition & 1 deletion examples/Aggregator/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Aggregator/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Blazor/Client/Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Blazor/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>46982f83-f153-443e-b589-4b2bc7b5945e</UserSecretsId>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion examples/Browser/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<SpaRoot>wwwroot\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(SpaRoot)dist\**</DefaultItemExcludes>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Certifier/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Certifier/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Channeler/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Channeler/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Coder/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Coder/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Compressor/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Compressor/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Container/Backend/Backend.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/Container/Backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
FROM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview AS build-env
WORKDIR /app

# Copy everything
Expand All @@ -8,7 +8,7 @@ RUN dotnet restore examples/Container/Backend
RUN dotnet publish examples/Container/Backend -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
FROM mcr.microsoft.com/dotnet/nightly/aspnet:8.0-preview
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Backend.dll"]
4 changes: 2 additions & 2 deletions examples/Container/Frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
FROM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview AS build-env
WORKDIR /app

# Copy everything
Expand All @@ -8,7 +8,7 @@ RUN dotnet restore examples/Container/Frontend
RUN dotnet publish examples/Container/Frontend -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
FROM mcr.microsoft.com/dotnet/nightly/aspnet:8.0-preview
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Frontend.dll"]
2 changes: 1 addition & 1 deletion examples/Container/Frontend/Frontend.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Counter/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Counter/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Downloader/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Downloader/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions examples/Frameworker/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#endregion

using System.Net.Http;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this needed?

Copy link
Member Author

@JamesNK JamesNK Aug 12, 2023

Choose a reason for hiding this comment

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

I'm not sure. It seems like global namespaces for .NET 4.x projects were updated to remove System.Net.Http in the .NET 8 SDK. I didn't investigate closely.

using Greet;
using Grpc.Net.Client;

Expand Down
2 changes: 1 addition & 1 deletion examples/Frameworker/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Greeter/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Greeter/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Interceptor/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Interceptor/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Liber/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Liber/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Locator/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Locator/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Mailer/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Mailer/Server/Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Progressor/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading