From 3907b3016493753e3fdee6e06343cfc0efdf54be Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 14 Nov 2023 13:49:01 -0800 Subject: [PATCH] Update to .NET 8. --- .github/workflows/build.yml | 4 ++-- Controllers/BadgeController.cs | 2 +- Data/PackageDependents.cs | 4 ++-- FuGetGallery.csproj | 20 ++++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7b6e56..b6c4b9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,10 @@ jobs: - uses: actions/checkout@v3 - - name: Set up .NET 7.0 + - name: Set up .NET 8.0 uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build run: | diff --git a/Controllers/BadgeController.cs b/Controllers/BadgeController.cs index 2d94b0b..15d3ac7 100644 --- a/Controllers/BadgeController.cs +++ b/Controllers/BadgeController.cs @@ -24,7 +24,7 @@ public async Task GetBadgeAsync (string id, string v) var content = DrawBadge (package); - HttpContext.Response.Headers.Add ("Cache-Control", "max-age=3600"); + HttpContext.Response.Headers["Cache-Control"] = "max-age=3600"; var r = Content(content); r.ContentType = "image/svg+xml"; return r; diff --git a/Data/PackageDependents.cs b/Data/PackageDependents.cs index f668ea9..c8d70e2 100644 --- a/Data/PackageDependents.cs +++ b/Data/PackageDependents.cs @@ -33,7 +33,7 @@ class PackageDependentsCache : DataCache { public PackageDependentsCache () : base (TimeSpan.FromMinutes (20)) { } - protected override async Task GetValueAsync (string lowerId, HttpClient httpClient, CancellationToken token) + protected override Task GetValueAsync (string lowerId, HttpClient httpClient, CancellationToken token) { // // ISSUE #155: Diabled due to database corruption. @@ -48,7 +48,7 @@ protected override async Task GetValueAsync (string lowerId, //catch (Exception ex) { // Console.WriteLine (ex); //} - return deps; + return Task.FromResult(deps); } } } diff --git a/FuGetGallery.csproj b/FuGetGallery.csproj index a5e889a..5afcce7 100644 --- a/FuGetGallery.csproj +++ b/FuGetGallery.csproj @@ -1,22 +1,22 @@  - net7.0 - 9.0 + net8.0 + 11.0 - - + + - - - + + + - - - + + +