Question: Nuget Packages not upgrading to Asp.Net 6 packages, I tried several times to upgrade the packages to the latest build but Visual Studio 2022 does not allow that to happen.
Please Login to see the rest of the answer
Answer: Make sure that your Asp.Net 5 Application or Library is targeting Asp.Net 6 first. Go to Project Properties and bump up the Target Version then save changes. After bumping up the version to target AspNet 6, then try to upgrade the Packages to Asp.Net 6 target build using Nuget Packages.
If everything goes well, you should now have all projects in your Project Solution target AspNet 6 and all its dependencies up to date. If the above does not help you, make sure that all the projects the Solution or the main Project has a dependency on are targeting the same framework version which is DotNet6.