Reinstall Nuget Package Manager in Visual Studio 2019

☆樱花仙子☆ 提交于 2020-08-19 11:03:10

问题


I am facing a problem with my project.

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?

This has happened before and I solved it by reinstalling the Nuget Package Manager using a command. Unfortunately, I am not finding that command again. I tried to find the solution online but everything I am getting is installing/reinstalling NuGet packages and not package manager.

Found this article: https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+Package+Manager+ but It's not applicable here.

NuGet Package Manager is preinstalled in VS2019 and no separate package to download and install. Also, there's not Extension Manage in VS2019 like older versions.

Please Let me know the command to reinstall NuGet Package Manager in Visual Studio 2019.


回答1:


Such nuget restore issues can normally fix by deleting the obj folder where files like project.assets.json, projectname.csproj.nuget.g.targets, projectname.csproj.nuget.g.props, projectname.csproj.nuget.dgspec.json and projectnamecsproj.nuget.cache.

If this still doesn't fix it, delete the hidden .vs folder inside the solution, where Visual Studio stores the user settings for the project.



来源:https://stackoverflow.com/questions/61286839/reinstall-nuget-package-manager-in-visual-studio-2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!