Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 查找NuGet包的引用时出错_Git_Visual Studio - Fatal编程技术网

Git 查找NuGet包的引用时出错

Git 查找NuGet包的引用时出错,git,visual-studio,Git,Visual Studio,我和一个小团队在做一个项目。我们使用Git for Visual Studio进行版本控制。 问题是,当我同步项目时,VisualStudio无法找到其他团队成员使用NuGet package manager添加的DLL。我怎样才能解决这个问题? 错误是: Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists

我和一个小团队在做一个项目。我们使用Git for Visual Studio进行版本控制。 问题是,当我同步项目时,VisualStudio无法找到其他团队成员使用NuGet package manager添加的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 remote server,因此当其他团队成员拉它时,您的团队成员只会得到如下设置:

<?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软件包。或者我不知道您是否可以在不卸载nuget设置的情况下找到dll并将其复制到您的朋友。

有时git restore会有帮助(解决方案上的contextmenu)

但有时会失败,您必须手动使用nugetconsole执行更新包-重新安装之类的操作 ()

也许您还可以尝试允许nuget管理软件包,以便nuget自动下载丢失的软件包