我试图使用nopCommerce(这是写在。net核心),但当我想运行项目时,我面临52个错误告诉我运行一个nuget包恢复

Assets文件~\obj\project.assets。Json没有找到。运行NuGet包还原生成此文件。Nop.Web.MVC.Testsote

当我使用右键单击解决方案并选择恢复Nuget包时,我得到这样的消息:

所有的包都已经安装,没有什么要恢复的。

但是这52个错误仍然存在,在工具-> NuGet包管理器->管理解决方案的NuGet包中,解决方案上没有安装任何东西,我最近更新了我的VS2017到15.5.4


当前回答

以管理员身份运行VS,然后在包管理控制台运行dotnet restore。

其他回答

For me it turned out to be a nuget source credentials problem. I had recently changed my password for accessing a nexus server and visual studio was still using the old password when trying to access a nuget on that server through the windows credential manager. To fix it, I had to delete the entry for those outdated credentials in the credential manager and after, when I did a nuget restore, it prompted me for a password letting me enter the new password, which got saved in the credential manager again. You can access the credential manager from the cmd line using CmdKey.exe.

当我得到这个错误时,对我有用的是添加一个全局变量。json文件,但这可能与使用Paket而不是Nuget有关。

以上这些对我都不起作用。但简单地删除所有“bin”和“obj”文件夹就可以了。

在visual studio 2017中,请执行以下步骤:

1)选择Tool=>Options=>NuGet Package Manager=> Package Sources然后取消勾选Microsoft Visual Studio Offline Packages Option。

2)现在打开工具=>NuGet包管理器=>包管理控制台。 3)在PM>中执行命令恢复dotnet。

希望它能起作用…

我没有任何NuGet在我的CLI/ c++。VS2022建造良好。然而,MSBuild不工作,给我错误NETSDK1004:资产文件…obj \ project.assets。Json没有找到。运行NuGet包还原生成此文件。

我的问题的解决方案是从vcxproj文件中删除以下内容。

<EnableManagedPackageReferenceSupport>true</EnableManagedPackageReferenceSupport>

我想把真改成假可能有用。我删除了行和MSBuild现在工作。