Skip to content

Commit

Permalink
Upgrade to .NET 9. (#60)
Browse files Browse the repository at this point in the history
Enabled implicit usings.
Updated packages.
Updated version.
  • Loading branch information
Digiman authored Dec 27, 2024
1 parent 749147b commit 8097ede
Show file tree
Hide file tree
Showing 60 changed files with 45 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/azure-webapps-dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: Build and deploy ASP.Net Core app to an Azure Web App
env:
AZURE_WEBAPP_NAME: services-dashboard-dev-win # set this to the name of your Azure Web App
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '8.0.x' # set this to the .NET version to use
DOTNET_VERSION: '9.0.x' # set this to the .NET version to use

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<Product>Simple Services Dashboard</Product>
<Company>[Company Name]</Company>
<Copyright>Copyright (c) [Company Name] 2024</Copyright>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
</PropertyGroup>
</Project>
51 changes: 26 additions & 25 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,43 @@
<ItemGroup>
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="8.0.2" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="Dodo.HttpClient.ResiliencePolicies" Version="2.1.0" />
<PackageVersion Include="FluentValidation" Version="11.9.2" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.2" />
<PackageVersion Include="FluentValidation" Version="11.11.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
<PackageVersion Include="Hellang.Middleware.ProblemDetails" Version="6.5.1" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.23.0" />
<PackageVersion Include="Serilog" Version="4.0.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageVersion Include="Serilog.Enrichers.ClientInfo" Version="2.1.1" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
<PackageVersion Include="Serilog" Version="4.2.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageVersion Include="Serilog.Enrichers.ClientInfo" Version="2.1.2" />
<PackageVersion Include="Serilog.Enrichers.CorrelationId" Version="3.0.1" />
<PackageVersion Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageVersion Include="Serilog.Exceptions" Version="8.4.0" />
<PackageVersion Include="Serilog.Expressions" Version="5.0.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.2" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.Seq" Version="8.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.3" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Serilog.Sinks.Seq" Version="9.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="7.2.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY ["src/SimpleServicesDashboard.Api/SimpleServicesDashboard.Api.csproj", "src/SimpleServicesDashboard.Api/"]
RUN dotnet restore "src/SimpleServicesDashboard.Api/SimpleServicesDashboard.Api.csproj"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using AutoMapper;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Asp.Versioning;
using AutoMapper;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SimpleServicesDashboard.Application.DTOs;
using SimpleServicesDashboard.Application.Modules.ServiceStatus.Queries;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Asp.Versioning;
using AutoMapper;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SimpleServicesDashboard.Application.DTOs;
using SimpleServicesDashboard.Application.Modules.Status.Queries;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Asp.Versioning.ApiExplorer;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;

namespace SimpleServicesDashboard.Api.Infrastructure.Configuration;

Expand Down
2 changes: 0 additions & 2 deletions src/SimpleServicesDashboard.Api/Infrastructure/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace SimpleServicesDashboard.Api.Infrastructure;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Asp.Versioning.ApiExplorer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.HttpOverrides;
using Serilog;
using SimpleServicesDashboard.Api.Infrastructure.Helpers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace SimpleServicesDashboard.Api.Infrastructure.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using Asp.Versioning;
using Hellang.Middleware.ProblemDetails;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using SimpleServicesDashboard.Api.Infrastructure.Configuration;
using SimpleServicesDashboard.Api.Infrastructure.HealthCheck;
Expand All @@ -16,10 +11,6 @@
using SimpleServicesDashboard.Common.Extensions;
using SimpleServicesDashboard.Infrastructure;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using ProblemDetailsOptions = Hellang.Middleware.ProblemDetails.ProblemDetailsOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using SimpleServicesDashboard.Common.Configuration;
using System.Collections.Generic;

namespace SimpleServicesDashboard.Api.Infrastructure.HealthCheck;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Options;
using SimpleServicesDashboard.Common.Configuration;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Infrastructure.HealthCheck;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Microsoft.AspNetCore.Http;
using Serilog;

namespace SimpleServicesDashboard.Api.Infrastructure.Helpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Linq;

namespace SimpleServicesDashboard.Api.Infrastructure.Swagger;

Expand Down
3 changes: 0 additions & 3 deletions src/SimpleServicesDashboard.Api/Models/DashboardViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

namespace SimpleServicesDashboard.Api.Models;

public sealed class DashboardViewModel
Expand Down
2 changes: 0 additions & 2 deletions src/SimpleServicesDashboard.Api/Pages/Dashboard.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using SimpleServicesDashboard.Api.Models;
using SimpleServicesDashboard.Application.Services.Interfaces;
using SimpleServicesDashboard.Common.Configuration;
using System.Linq;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Pages;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using SimpleServicesDashboard.Api.Models;
using SimpleServicesDashboard.Application.Services.Interfaces;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Api.Pages;

Expand Down
4 changes: 0 additions & 4 deletions src/SimpleServicesDashboard.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using Asp.Versioning.ApiExplorer;
using Hellang.Middleware.ProblemDetails;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using SimpleServicesDashboard.Api.Infrastructure.Extensions;
using SimpleServicesDashboard.Common.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<UserSecretsId>7461de0d-8c30-4021-9056-befd272ecdd8</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<DockerfileFile>..\..\Dockerfile</DockerfileFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using MediatR;
using Microsoft.Extensions.Logging;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Behaviours;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using MediatR;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Behaviours;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using FluentValidation;
using MediatR;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ValidationException = SimpleServicesDashboard.Application.Common.Exceptions.ValidationException;

namespace SimpleServicesDashboard.Application.Common.Behaviours;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using FluentValidation.Results;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SimpleServicesDashboard.Application.Common.Exceptions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Interfaces;

public interface IBaseHttpClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Interfaces;

public interface IEmailServiceAccess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Interfaces;

public interface IServiceAccess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using MediatR.Pipeline;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Processors;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using MediatR;
using MediatR.Pipeline;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Common.Processors;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace SimpleServicesDashboard.Application.DTOs;

public sealed class ServicesDescriptionResponseDto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

namespace SimpleServicesDashboard.Application.DTOs;

public sealed class ServicesStatusResponseDto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace SimpleServicesDashboard.Application.DTOs;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace SimpleServicesDashboard.Application.Models;

public sealed class ServicesDescriptionResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

namespace SimpleServicesDashboard.Application.Models;

public sealed class ServicesStatusResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace SimpleServicesDashboard.Application.Models;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using SimpleServicesDashboard.Application.Models;
using SimpleServicesDashboard.Application.Services.Interfaces;
using SimpleServicesDashboard.Common.Extensions;
using System.Threading;
using System.Threading.Tasks;

namespace SimpleServicesDashboard.Application.Modules.ServiceStatus.Queries;

Expand Down
Loading

0 comments on commit 8097ede

Please sign in to comment.