diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 890a96d..a48b065 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Build and Test run: dotnet test --verbosity normal - name: Build Docker image diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 07f622b..95612da 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -38,7 +38,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Build and Test run: dotnet test --verbosity normal - name: Generate Semantic Version diff --git a/.vscode/launch.json b/.vscode/launch.json index b72890e..a3f4ab8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/bin/Debug/net6.0/TeslaGateway_PrometheusProxy.dll", + "program": "${workspaceFolder}/src/bin/Debug/net9.0/SolarGateway_PrometheusProxy.dll", "args": [], "cwd": "${workspaceFolder}/src", "stopAtEntry": false, diff --git a/Dockerfile b/Dockerfile index 70f6fae..dd81013 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build ARG TARGETARCH @@ -8,7 +8,7 @@ RUN dotnet restore -a "$TARGETARCH" "SolarGateway_PrometheusProxy.csproj" COPY ./src . RUN dotnet publish -a "$TARGETARCH" "SolarGateway_PrometheusProxy.csproj" -c Release -o /app/publish -FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base RUN apk add --no-cache curl WORKDIR /app ENV ASPNETCORE_HTTP_PORTS=8080 diff --git a/src/SolarGateway_PrometheusProxy.csproj b/src/SolarGateway_PrometheusProxy.csproj index fcb4a86..73ddc22 100644 --- a/src/SolarGateway_PrometheusProxy.csproj +++ b/src/SolarGateway_PrometheusProxy.csproj @@ -2,6 +2,7 @@ net8.0 + net9.0 enable enable 31fa2fb2-a2a1-4a26-9a8b-8c574f8ba9d3 diff --git a/src/Support/MyHttpTraceActivityProcessor.cs b/src/Support/MyHttpTraceActivityProcessor.cs index 30d9928..d35dd36 100644 --- a/src/Support/MyHttpTraceActivityProcessor.cs +++ b/src/Support/MyHttpTraceActivityProcessor.cs @@ -54,7 +54,7 @@ public override void OnEnd(Activity activity) const string Path = "url.path"; var request = context.Request; var connection = context.Connection; - var path = (request.PathBase.HasValue || request.Path.HasValue) ? (request.PathBase + request.Path).ToString() : "/"; + var path = (request!.PathBase.HasValue || request.Path.HasValue) ? (request.PathBase + request.Path).ToString() : "/"; SetIpAddressTagIfDifferent(activity, ClientIP, connection.RemoteIpAddress?.ToString()); SetStringTagIfDifferent(activity, Scheme, request.Scheme); SetStringTagIfDifferent(activity, Host, request.Host.Host);