使用Visual Studio管理源代码控制中的引用 [英] Manage references in source control with Visual Studio

查看:150
本文介绍了使用Visual Studio管理源代码控制中的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Visual Studio中的项目中管理.dll引用。所有注册的.NET和COM引用都可以正常工作,但是在磁盘上的.dll文件中,如果我在磁盘上引用我的文件,我的同事将丢失引用,因为它们可能位于磁盘上的不同位置。 Visual Studio有一个环境变量,如$ PATH或某些东西,以便每台计算机都有先前的路径,然后再说它找不到引用?还是保持源控件中的.dll引用更好的选择?



好的,它工作得很好。在VS中,我刚刚将一个文件夹添加到解决方案中,将dll添加到文件夹中,并将所有内容添加到源代码控制。我在个别项目中提到这些dll,当我从其他电脑获取最新版本时,它正确连接。感谢你们

解决方案

这对Subversion和VSS都有效。



$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $((((((((((((((((
foo.dll第三方,即你不编译这个)
bar.dll
(不要把dll的项目1在这里,Visual Studio会照顾它)
\Project1
.proj文件在这里
\bin(不要把dll在这里!)
\Project2(这可能引用Project1

不要把dll放到\bin中,因为像VSS这样的存储库喜欢让它们只读,这会中断清理和重新构建。



Visual Studio不了解解决方案级别以上的依赖关系,因此如果您有解决方案依赖于解决方案,则必须在构建扫描/构建服务器中显示。


I'm having trouble managing my .dll references in projects in Visual Studio. All the registered .NET and COM references work fine but when it comes to .dll files on disk, if I refer to my files on disk, my colleagues will be missing references because they may have it in a different location on disk etc. Does Visual Studio have a environment variable like $PATH or something so that each computer have paths it will look in first before saying that it can't find a reference? Or is keeping the .dll references in the source control a better option?

Ok, it worked perfectly. In VS, I just added a folder to the solution, added the dlls to the folder and added everything to source control. I referred to those dlls in individual projects and when I get the latest version from other computers, it linked properly. Thanks guys

解决方案

This works for me, both in subversion and VSS.

\root
    \trunk
       foobar.sln (solution file goes here)
        \References
            foo.dll (3rd party, ie. you don't compile this)
            bar.dll
            (Don't put dll's for Project 1 here, Visual Studio will take care of it)
        \Project1
           .proj file goes here
              \bin  (don't put dll's here!)
        \Project2  (This might reference Project1

Don't put dll's into \bin because repositories like VSS like to make them readonly, which interrupts clean and re-build.

Visual Studio doesn't understand dependencies above the solution level, so if you have solutions that depend on solutions, you'll have to show that in your build scrips/build server.

这篇关于使用Visual Studio管理源代码控制中的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆