Upgraded BaGet solution from .NET Core 3.1 to .NET 8#805
Open
MarcBanyard wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BaGet .NET 8 Upgrade - Changes Summary
Overview
Upgraded BaGet solution from .NET Core 3.1 to .NET 8, updating all project files, dependencies, and resolving compatibility issues.
Project Files (.csproj)
Source Projects
src/BaGet/BaGet.csproj: UpdatedTargetFrameworkfromnetcoreapp3.1tonet8.0. Added<UseRidGraph>true</UseRidGraph>to resolve NETSDK1206 warning.src/BaGet.Web/BaGet.Web.csproj: UpdatedTargetFrameworkfromnetcoreapp3.1tonet8.0. Added<AddRazorSupportForMvc>true</AddRazorSupportForMvc>.src/BaGet.Protocol/BaGet.Protocol.csproj: UpdatedTargetFrameworkfromnetstandard2.0tonet8.0. RemovedSystem.Text.Jsonpackage reference (included in .NET 8).src/BaGet.Core/BaGet.Core.csproj: UpdatedTargetFrameworkfromnetstandard2.0tonet8.0.src/BaGet.Database.MySql/BaGet.Database.MySql.csproj: UpdatedTargetFrameworkfromnetstandard2.0tonet8.0. UpdatedPomelo.EntityFrameworkCore.MySqlto8.0.2.src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj: UpdatedTargetFrameworkfromnetstandard2.0tonet8.0. UpdatedNpgsql.EntityFrameworkCore.PostgreSQLto8.0.0.src/BaGet.Azure/BaGet.Azure.csproj: UpdatedTargetFrameworkfromnetstandard2.0tonet8.0. Added<UseRidGraph>true</UseRidGraph>to resolve NETSDK1206 warning.BaGet.Aws,BaGet.Gcp,BaGet.Aliyun,BaGet.Database.Sqlite,BaGet.Database.SqlServer): UpdatedTargetFrameworkfromnetstandard2.0tonet8.0.Test Projects
BaGet.Tests,BaGet.Core.Tests,BaGet.Web.Tests,BaGet.Protocol.Tests): UpdatedTargetFrameworkfromnetcoreapp3.1tonet8.0.Directory.Build.props
src/Directory.Build.propsLangVersionfromlatestto12.0(C# 12).MicrosoftAspNetCorePackageVersion:8.0.0MicrosoftEntityFrameworkCorePackageVersion:8.0.0MicrosoftExtensionsPackageVersion:8.0.0NuGetPackageVersion:6.10.0Microsoft.SourceLink.GitHub:8.0.0tests/Directory.Build.propsLangVersionfromlatestto12.0(C# 12).MicrosoftAspNetCorePackageVersion:8.0.0NewtonsoftJsonPackageVersion:13.0.3NuGetPackageVersion:6.10.0XUnitPackageVersion:2.9.0coverlet.collector:6.0.2Microsoft.NET.Test.Sdk:17.10.0Moq:4.20.70Dockerfile
mcr.microsoft.com/dotnet/aspnet:3.1tomcr.microsoft.com/dotnet/aspnet:8.0.mcr.microsoft.com/dotnet/sdk:3.1tomcr.microsoft.com/dotnet/sdk:8.0.Code Changes
Entity Framework Core Query Optimisation
File:
src/BaGet.Core/PackageDatabase.cs.AsSplitQuery()toFindAsync,FindOrNullAsync, andHardDeletePackageAsyncmethods to resolve EF Core warning about multiple collection includes and improve query performance.MySQL Database Provider Updates
File:
src/BaGet.Database.MySql/MySqlApplicationExtensions.csUseMySqlcall to useServerVersion.AutoDetect()instead of passing connection string directly (required by Pomelo EF Core 8).File:
src/BaGet.Database.MySql/MySqlContext.csMySql.Data.MySqlClienttoMySqlConnectorforMySqlException(Pomelo EF Core 8 uses MySqlConnector).Obsolete API Updates
File:
src/BaGet.Web/Extensions/IServiceCollectionExtensions.csSetCompatibilityVersion(CompatibilityVersion.Version_3_0)call.JsonSerializerOptions.IgnoreNullValues = truewithDefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull.Routing Fixes
File:
src/BaGet.Web/BaGetEndpointBuilder.cs/packagesroute mapping to redirect to Index page.using System.Threading.Tasks;for async route handler.File:
src/BaGet.Web/Pages/Index.cshtmlasp-route-versionfrom package links so clicking a package navigates to/packages/{id}(latest version).File:
src/BaGet.Web/Pages/Package.cshtmlasp-route-idto version links so clicking a specific version correctly navigates to/packages/{id}/{version}.Test Fixes
File:
tests/BaGet.Web.Tests/Pages/PackageModelFacts.csAssert.Equal(1, ...Count)withAssert.Single(...)to resolve xUnit analyser warning.Documentation
readme.mdNode.jsrequirement (frontend dependencies managed by LibMan).npm installstep.dotnet clean,dotnet restore,dotnet buildsteps.dotnet runcommand instructions.Warnings Resolved
<UseRidGraph>true</UseRidGraph>to projects with transitive dependencies using deprecated RIDs.System.Text.Jsonpackage reference (included in .NET 8).SetCompatibilityVersioncall.IgnoreNullValueswithDefaultIgnoreCondition.Assert.Single()instead ofAssert.Equal(1, ...)..AsSplitQuery()to queries with multiple collection includes.Breaking Changes Addressed
netstandard2.0tonet8.0for projects using EF Core.