gpt4 book ai didi

visual-studio - 为什么 Visual Studio 在 TFS checkin / checkout 后会丢失我的库映射?

转载 作者:行者123 更新时间:2023-12-02 01:34:03 25 4
gpt4 key购买 nike

我在一台机器上构建应用程序已经有一段时间了,最​​后进行了 TFS checkin 。

启动另一个新的工作区并进行 checkout ,解决方案不再编译,在整个解决方案的各个项目中,引用丢失和错误/警告如下所示:

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

我已经在相应的 common/lib 文件夹中的解决方案和其他导入的库/DLL 上启用了 Nuget 包还原。

我猜如果我 checkin 解决方案项目的 binobj 文件夹,一切都会正常进行。但是,TFS 通常用于代码,而不是 DLL。

那么,我该如何解决这个问题呢?

谢谢。

最佳答案

我不同意检查 bin 文件夹。有更好的方法来处理依赖关系,并且会根据依赖关系而有所不同!在这种情况下,使用您自己的代码,您可以考虑托管您自己的 NuGet 服务器:https://docs.nuget.org/create/hosting-your-own-nuget-feeds然后,您可以用相同的方式引用私有(private)和公共(public)程序集。

或者一种简单(更差)的方法是在解决方案的根目录下创建一个“依赖项”文件夹,将其与您的私有(private)程序集一起添加到源代码管理中,并从那里进行引用。

关于你的包恢复问题,我最近遇到了这样的问题,尝试删除你的包文件夹的内容(也从源代码中删除)但保留 repositories.config 并重新运行它。

关于visual-studio - 为什么 Visual Studio 在 TFS checkin / checkout 后会丢失我的库映射?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32240274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com