NuGet恢复包但缺少DLL [英] NuGet restoring packages but missing DLLs

查看:261
本文介绍了NuGet恢复包但缺少DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在计算机上成功运行了Visual Studio解决方案,但是当我将更改提交到BitBucket上并且另一个用户将项目拉下并在Visual Studio或TeamCity上构建后,我们收到了以下错误消息: :

I've had a Visual Studio solution running successfully on my machine but when I've committed the changes to BitBucket and another user has pulled down the project and built it on either Visual Studio or TeamCity we've received errors such as:

error CS0234: The type or namespace name 'Entity' does not exist in the namespace 
'System.Data' (are you missing an assembly reference?)

当我查看项目时,我可以看到每个NuGet软件包文件夹都存在,但是缺少DLL。这本身是一个容易修复;我只是删除有问题的程序包,在下一个版本中,NuGet会还原该程序包,并且现在存在DLL。

When I've looked at the project, I can see that each NuGet package folder is present but the DLLs are missing. This itself is an easy fix; I just delete the offending package and on the next build NuGet restores the package and the DLLs are now present.

我不明白的是为什么NuGet无法得到该程序包

What I don't understand is why NuGet is not getting the DLLs on the first attempt?

推荐答案

我花了一段时间才弄清楚发生了什么,但是问题不是NuGet ,这是源代码控制的设置。

It took me a while to work out what was happening, but the problem wasn't NuGet, it was the setup of source code control.

我没有将 packages 文件夹添加到忽略列表中水星。默认情况下,它将NuGet包上传到BitBucket,但忽略DLL。当另一个用户下载该项目时,它拉下了软件包,Visual Studio或TeamCity看到了软件包文件夹,并假定该软件包已被下载。将packages文件夹添加到.hgignore文件中,以后将阻止这种情况的发生。

I had not added the packages folder to the ignore list for Mercurial. By default, it was uploading the NuGet packages to BitBucket but ignoring the DLLs. When another user downloaded the project it pulled down the packages and Visual Studio or TeamCity saw the package folders and assumed the package was already downloaded. Addeing the packages folder to the .hgignore file will stop this happening in future.

这篇关于NuGet恢复包但缺少DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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