简体   繁体   English

NuGet软件包的错误定位参考

[英]Error Locating Reference of NuGet Package

I am working on a project with a small team. 我正在与一个小团队一起进行项目。 We use Git for Visual Studio for version control. 我们使用Git for Visual Studio进行版本控制。 The problem is that when I sync the project, visual studio can not locate dlls that are added using NuGet package manager by other team members. 问题是,当我同步项目时,Visual Studio无法找到其他团队成员使用NuGet程序包管理器添加的dll。 How can I resolve the problem? 我该如何解决该问题? The Error is: 错误是:

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.

because Git will only record change inside its folder, maybe you only push the packages.config to git remote server, so when the other team member pull it, your team member only got the setting like : 因为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>

without get the actual Newtonsoft.Json while pull it. 而没有得到实际的Newtonsoft.Json同时将其拉出。

so your team(other than you) need to uninstall and reinstall that nuget packages. 因此您的团队(除了您之外)需要卸载并重新安装该nuget软件包。 Or i dont know if maybe you can locate and copy also your dll to your friend without uninstall the nuget setting. 或者我不知道您是否可以找到dll并将其复制到您的朋友,而无需卸载nuget设置。

sometimes git restore helps (contextmenu on the solution) 有时git restore会有所帮助(解决方案上的上下文菜单)

some time that fails though and you have to manually use the nugetconsole to do something like update-package -reinstall ( http://blog.nuget.org/20121231/a-quick-tutorial-on-update-package-command.html ) 虽然有时会失败,但是您必须手动使用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