Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 not loading dependencies

I seem to be having an issue with running projects after upgrading to Visual Studio 2022 and installing Net 6.0 SDK. Whenever I open an existing project or even create a new one I get the below errors with the Dependencies.

enter image description here

If I try building the project I get the error:

enter image description here

There aren't any errors in the Error list.

Tried a few things but still nothing helps :

I've tried reinstalling Visual Studio 2022 and Net 6.0

  • Tried unloading and reloading project
  • Tried clearing Nuget cache
  • Tried removing bin,obj, csproj.user,.vs folder

If I try building/debugging a project in Visual Studio Code everything works normally so it doesn't seem to be an issue with the SDK.

Also noticed that I am unable to open the Nuget Package Manager UI but the .csproj file is correct and void of any errors.

Anyone have any ideas on how to resolve this?

like image 632
user2806570 Avatar asked Aug 03 '26 09:08

user2806570


2 Answers

I usually install the SDK's manually which seems to have caused the issue.

The solution to fixing this is to uninstall all manually installed SDK packages.

Following the SDK uninstall's, reinstall the net 6.0 and/or prior releases from the Visual Studio installer. I did a fresh install just incase.

All dependencies should load correctly now for net 6.0 projects. If not, please delete the .vs, bin and obj folder for the specific project and open it again in VS2022 and the dependencies should load. Delete the same folders for projects on previous versions.

like image 60
user2806570 Avatar answered Aug 05 '26 12:08

user2806570


have you tried dotnet build? that usually forces auto resolving of dependencies!

I've also faced similar issues in recent days after the final release of 2022.

like image 43
Yasir Arafat Avatar answered Aug 05 '26 13:08

Yasir Arafat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!