在 Visual Studio 2019 中重新安装 Nuget 包管理器 [英] Reinstall Nuget Package Manager in Visual Studio 2019

查看:635
本文介绍了在 Visual Studio 2019 中重新安装 Nuget 包管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目遇到了问题.

找不到类型或命名空间名称System"(您是否缺少 using 指令或程序集引用?

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

这以前发生过,我通过使用命令重新安装 Nuget 包管理器来解决它.不幸的是,我再也找不到那个命令了.我试图在网上找到解决方案,但我得到的一切都是安装/重新安装 NuGet 包而不是包管理器.

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.

发现这篇文章:https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+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 包管理器预装在 VS2019 中,无需下载和安装单独的包.此外,VS2019 中没有像旧版本那样的扩展管理.

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.

请告诉我在 Visual Studio 2019 中重新安装 NuGet 包管理器的命令.

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

推荐答案

此类 nuget 还原问题通常可以通过删除 obj 文件夹来解决,其中 nuget 文件如 project.assets.jsonprojectname.csproj.nuget.g.targetsprojectname.csproj.nuget.g.propsprojectname.csproj.nuget.dgspec.jsonprojectnamecsproj.nuget.cache 被存储.

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

如果仍然不能解决问题,请删除 解决方案中隐藏的 .vs 文件夹,其中 Visual Studio 存储项目的用户设置.

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.

这篇关于在 Visual Studio 2019 中重新安装 Nuget 包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆