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

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

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

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

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


当前回答

在vs -2019 vs 16.4.0上添加WinForms Core 3.1项目(从项目模板中)并尝试开箱运行后看到了这一点。清理或重新构建整个解决方案不起作用。

我刚刚重新加载了我的解决方案。即文件/关闭解决方案,然后重新打开并重新构建它就解决了问题。

其他回答

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

造成这个缺陷的原因:你必须在文件资源管理器中删除注入的Nuget。 解决方案:一旦你在你的系统中删除了Nuget,然后从下面的位置删除。 选择工具=>选项=>NuGet包管理器=>包源,然后取消勾选Microsoft Visual Studio离线包选项

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.

当我在VS2017中创建一个lambda in dot net core时,我得到了错误。对我来说有用的是卸载项目并重新加载它。

在我的例子中,我在*中添加了以下内容。在“Clean”上完全删除obj和bin文件夹。显然,它就是罪魁祸首。摆脱了那个和中提琴,一切又开始运转了。现在我正在使用“清洁垃圾箱”扩展代替。希望这可以帮助任何遇到这个问题的人,上面提到的修复都不起作用。

<Target Name="SuperClean" AfterTargets="Clean">
    <!-- Remove obj folder -->
    <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
    <!-- Remove bin folder -->
    <RemoveDir Directories="$(BaseOutputPath)" />
</Target>