NuGet restoring packages but missing DLLs

狂风中的少年 提交于 2019-12-23 19:57:02

问题


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?)

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.

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/44829117/nuget-restoring-packages-but-missing-dlls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!