How to upgrade Asp.Net 5 Application to Asp.Net 6 Nuget Packages not upgrading

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.

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.

- Enjoy

Edit this Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2022 - ErnesTech - Privacy