简体   繁体   English

在 Visual Studio 2019 中重新安装 Nuget Package 管理器

[英]Reinstall Nuget Package Manager in Visual Studio 2019

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?找不到类型或命名空间名称“System”(您是否缺少 using 指令或程序集引用?

在此处输入图像描述

This has happened before and I solved it by reinstalling the Nuget Package Manager using a command.这以前发生过,我通过使用命令重新安装 Nuget Package 管理器来解决它。 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.我试图在网上找到解决方案,但我得到的只是安装/重新安装 NuGet 包,而不是 package 管理器。

Found this article: https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+Package+Manager+ but It's not applicable here.找到这篇文章: https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+Package+Manager+但这里不适用。

NuGet Package Manager is preinstalled in VS2019 and no separate package to download and install. NuGet Package Manager 预装在 VS2019 中,没有单独的 package 下载和安装。 Also, there's not Extension Manage in VS2019 like older versions.此外,VS2019 中没有像旧版本那样的扩展管理。

Please Let me know the command to reinstall NuGet Package Manager in Visual Studio 2019.请让我知道在 Visual Studio 2019 中重新安装 NuGet Package 管理器的命令。

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. 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.jsonprojectnamecsproj.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.如果这仍然不能解决问题,请删除解决方案中隐藏的.vs文件夹,Visual Studio 在其中存储项目的用户设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Nuget package 管理器未在 Visual Studio 2019 中恢复包 - Nuget package manager not restoring packages in visual studio 2019 Visual Studio 2019 Nuget 找不到 package - Visual Studio 2019 Nuget cannot find a package Visual Studio 2019 - package 管理器 GUI 在使用本地 Nuget 存储库时冻结,但当提琴手工作时它工作得很快 - Visual studio 2019 - package manager GUI freezes when using local Nuget repository but when fiddler is working it works fast 在 Visual Studio 2019 中搜索拥有程序集的 NuGet Package - Search for owning NuGet Package of an assembly in Visual Studio 2019 (405)Visual Studio 2017(NuGet)程序包管理器不允许使用的方法 - (405) Method Not Allowed with Visual Studio 2017 (NuGet) Package Manager 从Visual Studio NuGet管理器安装MailChimp.NET程序包 - Installing MailChimp.NET package from Visual Studio NuGet manager 没有Visual Studio的软件包管理器,如何更新nuget软件包? - How to update nuget packages without package manager of visual studio? Visual Studio和Nuget:程序包管理器控制台命令历史记录? - Visual Studio & Nuget: Package Manager Console commands history? 在Visual Studio Nuget包管理器控制台中中止“unclosed”powershell命令 - Aborting an “unclosed” powershell command in Visual Studio Nuget Package manager console Visual Studio Nuget 管理器不显示 OpenTK package - Visual Studio Nuget manager does not show OpenTK package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM