At the end of each release cycle, we update our Major Version (branding version of build assets) & TFM (Target Framework Moniker) in main, in preparation for the next major release. This doc describes the process of doing those updates, which can include many subtle gotchas in the aspnetcore repo.
In the event that we do a minor release (e.g. 3.1), the guidance in this document still applies (but with all instances of MajorVersion replaced by MinorVersion).
Typically, we will update the Major Version before updating the TFM. This is because updating Major Version only requires a logical agreement that main is no longer the place for work on the previous major release, while updating the TFM requires waiting for dotnet/runtime to update their TFM so that we can ingest that change. For an example, this is the PR where we updated our branding from 6.0.0 to 7.0.0 (note that branding does not have to happen in a dependency update PR - this particular branding exercise needed to include some reaction to runtime changes).
AspNetCoreMajorVersion by 1.PreReleaseVersionIteration to 1.PreReleaseVersionLabel to alpha.PreReleaseBrandingLabel to Alpha $(PreReleaseVersionIteration).ListedTargetingPackAssemblies by incrementing the AssemblyVersion of all aspnetcore assemblies by 1 major version. Once dotnet/runtime updates their AssemblyVersions, we also need to update those in this file. They typically make that change at the same time as their TFM update, but we change our AssemblyVersions as soon as we update branding.dotnet7 and dotnet7-transport) and adding entries for the new feeds (dotnet8 and dotnet8-transport). Make an effort to remove old feeds here at the same time._templatePackages for Microsoft.DotNet.Web.ProjectTemplates and Microsoft.DotNet.Web.Spa.ProjectTemplates matching the new version.<LangVersion> to be a hardcoded version instead of preview. (e.g. If main is being updated to 8.0.0 modify the <LangVersion> in the release/7.0 branch). See https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#defaults to find what language version to use.MajorVersion to 8, packages should be branded 8.0.0-alpha.1.{BuildNumber}).AssemblyVersion (e.g. if you have just updated MajorVersion to 8, Assemblies should have AssemblyVersion 8.0.0.0).Once dotnet/runtime has updated their TFM, we update ours in the dependency update PR ingesting that change. We won't be able to ingest new dotnet/runtime dependencies in main until this is done. For an example, this is the PR where we updated our TFM to net7.0. This step can be tricky - we have workarounds in eng/tools/GenerateFiles/Directory.Build.targets.in to make the build work before we get an SDK containing runtime references with the new TFM. We copy the KnownFrameworkReference, KnownRuntimePack, and KnownAppHostPack from the previous TFM, give them the incoming runtime dependency versions, and give them the new TFM (these TFMs no-op most of the time - they only apply during this period when we're using an SDK that doesn't know about the new TFM). These workarounds allow us to build against the new TFM before we get an SDK with a reference to it, but there are often problems that arise in this area. The best way to debug build errors related to FrameworkReferences it to get a binlog of a failing project (dotnet build /bl) and look at the inputs to the task that failed. Confirm that the Known___ items look as expected (there is an entry with the current TFM & the current dotnet/runtime dependency version), and look at the source code of the task in dotnet/sdk for hints.
DefaultNetCoreTargetFramework by 1.net7, replace with net8). See the PR linked above for examples - this shouldn't be done blindly, but on a case-by-case basis. Most things should be updated, and most choices should be obvious.
DefaultNetCoreTargetFramework.SiteExtensions package for the previous Major Version.
Microsoft.AspNetCore.AzureAppServices.SiteExtension.{PreviousMajorVersion}.0.x64 and Microsoft.AspNetCore.AzureAppServices.SiteExtension.{PreviousMajorVersion}.0.x86.release/{n}.0 branch in dotnet/spa-template based off of main, where n is the MajorVersion we are updating from (not the one we are updating to).aspnetcore to reference the new release branch you just created in dotnet/spa-templates.main branch of dotnet/spa-templates.precedence and identity elements in all template.json files.
precedence, identity, and (if it exists) thirdPartyNotices elements in all template.json files.
thirdPartyNotices exists.ReferenceAssemblies.Net.Netx0 with the latest version.Typically we update the SDK we use in main every Monday. Once we have one that contains Microsoft.Netcore.App entries with the new TFM, we can update eng/tools/RepoTasks/RepoTasks.csproj, eng/tools/RepoTasks/RepoTasks.tasks, and eng/tools/HelixTestRunner/HelixTestRunner.csproj to use DefaultNetCoreTargetFramework again rather than hard-coding the previous TFM.