繁体   English   中英

NuGet软件包的错误定位参考

[英]Error Locating Reference of NuGet Package

我正在与一个小团队一起进行项目。 我们使用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.

因为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设置。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM