Skip to content

Commit

Permalink
Upgrade to .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
DrEsteban committed Nov 21, 2024
1 parent 6b6f9d2 commit de5d94b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/SolarGateway_PrometheusProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>31fa2fb2-a2a1-4a26-9a8b-8c574f8ba9d3</UserSecretsId>
Expand Down
2 changes: 1 addition & 1 deletion src/Support/MyHttpTraceActivityProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit de5d94b

Please sign in to comment.