From 88adc96477673ec54d7f83b3761d981c307bed44 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Wed, 9 Oct 2024 16:33:01 -0500 Subject: [PATCH] Upgrade to .NET 9 RC2 (#1708) --- .devcontainer/Dockerfile | 2 +- .github/workflows/build-arm64.yml | 4 ++-- .github/workflows/build.yaml | 8 ++++---- .github/workflows/elasticsearch-docker-7.yml | 4 ++-- .github/workflows/elasticsearch-docker-8.yml | 4 ++-- .vscode/launch.json | 4 ++-- Dockerfile | 16 ++++++++-------- README.md | 2 +- global.json | 2 +- src/Directory.Build.props | 5 +++-- src/Exceptionless.Core/Exceptionless.Core.csproj | 8 ++++---- .../Exceptionless.Insulation.csproj | 12 ++++++------ src/Exceptionless.Job/Exceptionless.Job.csproj | 2 +- .../grunt/task-configs/connect.js | 4 ++-- src/Exceptionless.Web/Exceptionless.Web.csproj | 6 +++--- .../Exceptionless.Tests.csproj | 4 ++-- 16 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a4f8e455ba..63ebf80619 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/dotnet:0-8.0 +FROM mcr.microsoft.com/devcontainers/dotnet:0-9.0 RUN apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts diff --git a/.github/workflows/build-arm64.yml b/.github/workflows/build-arm64.yml index 6e21dfc7df..d81b9fed25 100644 --- a/.github/workflows/build-arm64.yml +++ b/.github/workflows/build-arm64.yml @@ -25,8 +25,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.* - #dotnet-quality: preview + dotnet-version: 9.0.* + dotnet-quality: preview - name: Build Reason env: GITHUB_EVENT: ${{ toJson(github) }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a2c4f3333c..0e1ead9a29 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -38,8 +38,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.* - #dotnet-quality: preview + dotnet-version: 9.0.* + dotnet-quality: preview - name: Version id: version @@ -64,8 +64,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.* - #dotnet-quality: preview + dotnet-version: 9.0.* + dotnet-quality: preview - name: Start Services working-directory: docker diff --git a/.github/workflows/elasticsearch-docker-7.yml b/.github/workflows/elasticsearch-docker-7.yml index fa044a20ef..8fba79bf00 100644 --- a/.github/workflows/elasticsearch-docker-7.yml +++ b/.github/workflows/elasticsearch-docker-7.yml @@ -18,8 +18,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.* - #dotnet-quality: preview + dotnet-version: 9.0.* + dotnet-quality: preview - name: Build Reason env: GITHUB_EVENT: ${{ toJson(github) }} diff --git a/.github/workflows/elasticsearch-docker-8.yml b/.github/workflows/elasticsearch-docker-8.yml index 7c1d8bbecc..5e36530da0 100644 --- a/.github/workflows/elasticsearch-docker-8.yml +++ b/.github/workflows/elasticsearch-docker-8.yml @@ -18,8 +18,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.* - #dotnet-quality: preview + dotnet-version: 9.0.* + dotnet-quality: preview - name: Build Reason env: GITHUB_EVENT: ${{ toJson(github) }} diff --git a/.vscode/launch.json b/.vscode/launch.json index fae4e618c6..5cf0a324fa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Exceptionless.Web/bin/Debug/net8.0/Exceptionless.Web.dll", + "program": "${workspaceFolder}/src/Exceptionless.Web/bin/Debug/net9.0/Exceptionless.Web.dll", "args": [], "cwd": "${workspaceFolder}/src/Exceptionless.Web", "stopAtEntry": false, @@ -25,7 +25,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Exceptionless.Job/bin/Debug/net8.0/Exceptionless.Job.dll", + "program": "${workspaceFolder}/src/Exceptionless.Job/bin/Debug/net9.0/Exceptionless.Job.dll", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, diff --git a/Dockerfile b/Dockerfile index aee26cdfee..f2f5dcc843 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /app COPY ./*.sln ./NuGet.Config ./ @@ -36,7 +36,7 @@ RUN dotnet publish -c Release -o out # job -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS job +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS job WORKDIR /app COPY --from=job-publish /app/src/Exceptionless.Job/out ./ @@ -50,13 +50,13 @@ FROM build AS api-publish WORKDIR /app/src/Exceptionless.Web RUN apt-get update -yq -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -yq nodejs +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -yq nodejs RUN dotnet publish -c Release -o out /p:SkipSpaPublish=true # api -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS api +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS api WORKDIR /app COPY --from=api-publish /app/src/Exceptionless.Web/out ./ @@ -70,13 +70,13 @@ FROM build AS app-publish WORKDIR /app/src/Exceptionless.Web RUN apt-get update -yq -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -yq nodejs +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -yq nodejs RUN dotnet publish -c Release -o out # app -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS app +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS app WORKDIR /app COPY --from=app-publish /app/src/Exceptionless.Web/out ./ @@ -148,7 +148,7 @@ USER elasticsearch RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ chmod +x dotnet-install.sh && \ - ./dotnet-install.sh --channel 8.0 --quality ga --runtime aspnetcore && \ + ./dotnet-install.sh --channel 9.0 --quality preview --runtime aspnetcore && \ rm dotnet-install.sh EXPOSE 8080 9200 @@ -206,7 +206,7 @@ USER elasticsearch RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ chmod +x dotnet-install.sh && \ - ./dotnet-install.sh --channel 8.0 --quality ga --runtime aspnetcore && \ + ./dotnet-install.sh --channel 9.0 --quality preview --runtime aspnetcore && \ rm dotnet-install.sh EXPOSE 8080 9200 diff --git a/README.md b/README.md index b1f2711834..b33cb977b4 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ _In appreciation for anyone who submits a non-trivial pull request, we will give - Please read the [contributing document](https://github.com/exceptionless/Exceptionless/blob/main/CONTRIBUTING.md) - Requirements - [Docker](https://www.docker.com/get-docker) - - [.NET 8.0](https://dotnet.microsoft.com/) + - [.NET 9.0](https://dotnet.microsoft.com/) - [Node 20+](https://nodejs.org/) - Visual Studio Code - Open Visual Studio Code and then open the Exceptionless root folder diff --git a/global.json b/global.json index c19a2e057c..7f873f4e9d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.100-rc*", "rollForward": "latestMinor" } } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 155b6e38ba..dfc8b7fcfc 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0 + net9.0 enable Exceptionless true @@ -8,8 +8,9 @@ Copyright (c) 2024 Exceptionless. All rights reserved. https://github.com/exceptionless/exceptionless Exceptionless - $(NoWarn);CS1591 + $(NoWarn);CS1591; enable + NU1902;NU1903;NU1904; true true true diff --git a/src/Exceptionless.Core/Exceptionless.Core.csproj b/src/Exceptionless.Core/Exceptionless.Core.csproj index 5766e6b628..ee093ca6b0 100644 --- a/src/Exceptionless.Core/Exceptionless.Core.csproj +++ b/src/Exceptionless.Core/Exceptionless.Core.csproj @@ -27,11 +27,11 @@ - - - + + + - + diff --git a/src/Exceptionless.Insulation/Exceptionless.Insulation.csproj b/src/Exceptionless.Insulation/Exceptionless.Insulation.csproj index 19dfd49cf7..6aef7e045d 100644 --- a/src/Exceptionless.Insulation/Exceptionless.Insulation.csproj +++ b/src/Exceptionless.Insulation/Exceptionless.Insulation.csproj @@ -8,12 +8,12 @@ - - - - - - + + + + + + diff --git a/src/Exceptionless.Job/Exceptionless.Job.csproj b/src/Exceptionless.Job/Exceptionless.Job.csproj index 7cb0d251d8..95d7a5b23c 100644 --- a/src/Exceptionless.Job/Exceptionless.Job.csproj +++ b/src/Exceptionless.Job/Exceptionless.Job.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Exceptionless.Web/ClientApp.angular/grunt/task-configs/connect.js b/src/Exceptionless.Web/ClientApp.angular/grunt/task-configs/connect.js index bc8305b5bd..8000e545d6 100644 --- a/src/Exceptionless.Web/ClientApp.angular/grunt/task-configs/connect.js +++ b/src/Exceptionless.Web/ClientApp.angular/grunt/task-configs/connect.js @@ -5,8 +5,8 @@ var s = require("child_process"); var proxyRequest = require("grunt-connect-proxy2/lib/utils").proxyRequest; module.exports = function () { - var certs = generateCerts(); var target = getTarget(); + var certs = target.ssl ? generateCerts() : { cert: undefined, key: undefined }; return { main: { @@ -85,7 +85,7 @@ function getTarget() { }; } -/** Function taken from aspnetcore-https.js in ASP.NET React template */ +/** Function taken from aspnetcore-https.js in ASP.NET React template https://github.com/microsoft/commercial-marketplace-offer-deploy/blob/main/src/ClientApp/ClientApp/aspnetcore-https.ts */ function generateCerts() { var baseFolder = process.env.APPDATA !== undefined && process.env.APPDATA !== "" diff --git a/src/Exceptionless.Web/Exceptionless.Web.csproj b/src/Exceptionless.Web/Exceptionless.Web.csproj index 5eeb77b20d..17db850bd3 100644 --- a/src/Exceptionless.Web/Exceptionless.Web.csproj +++ b/src/Exceptionless.Web/Exceptionless.Web.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/tests/Exceptionless.Tests/Exceptionless.Tests.csproj b/tests/Exceptionless.Tests/Exceptionless.Tests.csproj index d4f9938ff3..c1016631b3 100644 --- a/tests/Exceptionless.Tests/Exceptionless.Tests.csproj +++ b/tests/Exceptionless.Tests/Exceptionless.Tests.csproj @@ -9,8 +9,8 @@ - - + +