【发布时间】:2015-08-27 03:36:34
【问题描述】:
我在一台机器上构建应用程序已经有一段时间了,最后做了一个 TFS 签入。
启动另一个新工作区并进行签出,解决方案不再编译,其中引用已丢失,并且在整个解决方案的各个项目中出现如下错误/警告:
The type or namespace name 'OData' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
Could not resolve this reference. Could not locate the assembly "EntityFramework".
还有
Warning 1 The "EnsureBindingRedirects" task could not be loaded from the assembly C:\TFS-WorkRepository\Project\Project Solution - v001\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.Tasks.dll.
Could not load file or assembly 'file:///C:\TFS-WorkRepository\Project\Project Solution -
v001\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.Tasks.dll'
or one of its dependencies. The system cannot find the file specified. Confirm
that the <UsingTask> declaration is correct, that the assembly and all its
dependencies are available, and that the task contains a public class that
implements Microsoft.Build.Framework.ITask. Project.AdminWebsite
我已经在解决方案和其他导入的库/DLL 上启用了 Nuget 包还原,这些库/DLL 位于相应的 common/lib 文件夹中。
我猜如果我签入解决方案项目的bin 和obj 文件夹,一切都会正常工作。但是通常 TFS 用于代码,而不是 DLL。
那么,我该如何解决这个问题?
谢谢。
【问题讨论】:
-
您也必须 签入
bin文件夹,因为dll项目从那里引用,可能是丢失文件的可能性之一 和obj不确定。关于您的EnsureBindingRedirects问题,您可以找到解决方案 here -
bin 是一个糟糕的引用位置,因为如果从其他地方引用,它有时可能是 dll 的本地副本。例如将本地复制设置为 true 的 GAC。请记住,该 bin 用于构建 输出!
标签: visual-studio tfs