找到NuGet包的引用时出错

时间:2013-06-19 18:27:50

标签: git visual-studio

我正在与一个小团队合作开展一个项目。我们使用Git for Visual Studio进行版本控制。 问题是,当我同步项目时,visual studio无法找到其他团队成员使用NuGet包管理器添加的dll。我该如何解决这个问题? 错误是:

Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

2 个答案:

答案 0 :(得分:0)

因为Git只记录其文件夹内的更改,也许您只需将packages.config推送到git远程服务器,所以当其他团队成员拉出它时,您的团队成员只能得到如下设置:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
</packages>

没有得到实际的Newtonsoft.Json同时拉它。

因此您的团队(除了您)需要卸载并重新安装该nuget软件包。或者我不知道你是否可以找到并将你的dll复制到你的朋友而无需卸载nuget设置。

答案 1 :(得分:0)

有时git restore帮助(解决方案的上下文菜单)

虽然有些时候失败,但您必须手动使用nugetconsole来执行类似update-package -reinstall的操作 (http://blog.nuget.org/20121231/a-quick-tutorial-on-update-package-command.html

相关问题