簡體   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