Dotnet Core解决方案还原失败 [英] Dotnet Core solution failed restore

查看:1191
本文介绍了Dotnet Core解决方案还原失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个解决方案文件,其中包含几个项目,这些项目可以同时使用 dotnet CLI和Visual Studio 2017在我的计算机上构建。从字面上看,该构建将在一夜之间失败,并且我无法关联可能归因于此的更改失败。 VS2017和CLI均失败,并显示如下消息:

We have a solution file which contains several projects which builds just fine on my computer using both "dotnet" CLI as well as Visual Studio 2017. Literally overnight, the build would fail, and I cannot associate the change that may have attributed to the failure. Both VS2017 and CLI failed with a message like this:

C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97 ,5):错误:无法从远程源'D:\mtp\proj.vs\hello_proj\bin\Release\PublishOutput'中检索有关'System.Xml.XmlDocument'的信息。 [D:\mtp\proj.vs\server-ray\my_solution.sln]

C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Failed to retrieve information about 'System.Xml.XmlDocument' from remote source 'D:\mtp\proj.vs\hello_proj\bin\Release\PublishOutput'. [D:\mtp\proj.vs\server-ray\my_solution.sln]

这是令人误解的,因为hello_proj似乎表明了这一点配置为用于构建调试,与显示的发行相反。我已经尝试清除所有缓存的程序包,将程序包复制到解决方案所在的位置,并将程序包复制到错误指示的位置,但是我无法克服此错误。 Nuget显然是在某个地方获取了一些信息,以便在错误的位置查找软件包,但我真的不知道它从何处获取该信息。我还验证了 global-packages文件夹中是否存在缺失软件包(通过运行 nuget local all -list找到)。

This is is misleading, as the hello_proj where this seems to indicate, is configured for building "Debug" as oppose to the "Release" shown. I have already attempted to clear out all cached packages, copied packages to where the solution resides, and copied the packages to where the error indicates, but I could not get over this error. Nuget is obviously getting some information somewhere to look for the packages in the wrong place, but I don't really know where it gets that info from. I also verified that the "missing" packages exist in the "global-packages" folder (found by running "nuget local all -list").

我感谢任何使用一些了解为什么会这样。谢谢。

I appreciate anyone with some insight into why this is happening. Thanks.

推荐答案

确实模糊不清,但是我发现了可以解决问题的方法。我在整个C:驱动器中搜索了Nuget.Config,并在%appdata%\Nuget\Nuget.config中找到了一个。我删除了它,构建成功进行了。 Nuget.config已还原为解决该问题的一些默认值。我无法解释;只是很高兴它起作用。

Really obscured, but I found something that fixed my problem. I searched for Nuget.Config in the entire C: drive and found one in %appdata%\Nuget\Nuget.config. I removed it and the build went through successfully. The Nuget.config was restored to some default values that fixed the problem. I can't explain it; just glad it worked.

这篇关于Dotnet Core解决方案还原失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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