From 0eddef0164ca61c49f52b737bb8636703bbee012 Mon Sep 17 00:00:00 2001 From: nileshgnagepatil Date: Mon, 18 Sep 2023 16:13:13 +0100 Subject: [PATCH] Upgraded Framework version to .NET 7 --- .github/workflows/coverage.yml.old | 2 +- .github/workflows/dotnet.yml | 2 +- .../Childrens-Social-Care-CPD-Tests.csproj | 2 +- .../Childrens-Social-Care-CPD.csproj | 2 +- Childrens-Social-Care-CPD/Dockerfile | 4 ++-- .../WebApplicationBuilderExtensions.cs | 23 ++++++++----------- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/coverage.yml.old b/.github/workflows/coverage.yml.old index 8f2ce079..0c0178b8 100644 --- a/.github/workflows/coverage.yml.old +++ b/.github/workflows/coverage.yml.old @@ -17,7 +17,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 92769bd4..28b43904 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -17,7 +17,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/Childrens-Social-Care-CPD-Tests/Childrens-Social-Care-CPD-Tests.csproj b/Childrens-Social-Care-CPD-Tests/Childrens-Social-Care-CPD-Tests.csproj index a679d66e..ac36fb2b 100644 --- a/Childrens-Social-Care-CPD-Tests/Childrens-Social-Care-CPD-Tests.csproj +++ b/Childrens-Social-Care-CPD-Tests/Childrens-Social-Care-CPD-Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 Childrens_Social_Care_CPD_Tests disable false diff --git a/Childrens-Social-Care-CPD/Childrens-Social-Care-CPD.csproj b/Childrens-Social-Care-CPD/Childrens-Social-Care-CPD.csproj index 1b679567..0f234b29 100644 --- a/Childrens-Social-Care-CPD/Childrens-Social-Care-CPD.csproj +++ b/Childrens-Social-Care-CPD/Childrens-Social-Care-CPD.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 disable enable Childrens_Social_Care_CPD diff --git a/Childrens-Social-Care-CPD/Dockerfile b/Childrens-Social-Care-CPD/Dockerfile index 44de42fa..970ff45b 100644 --- a/Childrens-Social-Care-CPD/Dockerfile +++ b/Childrens-Social-Care-CPD/Dockerfile @@ -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:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src COPY ["Childrens-Social-Care-CPD.csproj", "."] RUN dotnet restore "./Childrens-Social-Care-CPD.csproj" diff --git a/Childrens-Social-Care-CPD/WebApplicationBuilderExtensions.cs b/Childrens-Social-Care-CPD/WebApplicationBuilderExtensions.cs index 3c8d2084..b450133c 100644 --- a/Childrens-Social-Care-CPD/WebApplicationBuilderExtensions.cs +++ b/Childrens-Social-Care-CPD/WebApplicationBuilderExtensions.cs @@ -40,19 +40,16 @@ public static void AddFeatures(this WebApplicationBuilder builder) var applicationConfiguration = new ApplicationConfiguration(); - builder.Host - .ConfigureLogging(logging => logging.AddAzureWebAppDiagnostics()) - .ConfigureServices(serviceCollection => serviceCollection - .Configure(options => - { - options.FileName = "azure-diagnostics-"; - options.FileSizeLimit = 50 * 1024; - options.RetainedFileCountLimit = 5; - }).Configure(options => - { - options.BlobName = "log.txt"; - }) - ); + builder.Logging.AddAzureWebAppDiagnostics(); + builder.Services.Configure(options => + { + options.FileName = "azure-diagnostics-"; + options.FileSizeLimit = 50 * 1024; + options.RetainedFileCountLimit = 5; + }).Configure(options => + { + options.BlobName = "log.txt"; + }); builder.Services.AddResponseCompression(); builder.Services.AddControllersWithViews();