Visual Studio 和 SVN 的正确设置

发布于 2025-01-04 16:34:05 字数 339 浏览 0 评论 0原文

我想要设置一个项目,并可能设置一个现有项目以进行 SVN 版本控制。我使用 uberSVN 作为 svn 服务器。我已经为 Visual Studio 安装了 AnkhSVN。

目前,与我合作的团队正在使用视觉源安全,我们遇到的问题之一是当有人添加对 DLL 的引用时,它会按照您的预期修改项目文件,但不同团队成员之间的路径不同( XP 盒子,7,你懂的)。我想要的是在签入/签出时忽略项目文件,这样我们就不会弄乱其他人的引用。

有没有办法让 SVN 忽略插件中的这些文件?这样做的副作用之一是人们不知道项目中是否添加了新文件,因为这会修改项目文件。除了告诉每个人“嘿,您需要手动将此文件添加到您的项目中”之外,还有更干净的方法吗?

I am wanting to setup a project and potentially an existing project to be SVN version controlled. I am using uberSVN for the svn server. I have installed AnkhSVN for visual studio.

Currently, the team I am working with is using visual source safe and one of the problems we have is when someone adds a reference to a DLL, it modifies the project file as you would expect, but our paths are different between different team members (XP boxes, 7, you get the idea). What I was wanting is making the project file ignored when checking in/out so that we don't mess up the references for everyone else.

Is there a way I can make SVN ignore these files within the plugin? One of the side effects of this is a person would not know if a new file has been added in the project as this modifies the project file. Other than telling everyone "hey, you need to manually add this file to your project," is there a cleaner way of doing it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉城メ夜风 2025-01-11 16:34:05

如果在链接到 DLL 之前将 DLL 复制到 VS 解决方案文件夹内的文件夹中,我认为项目链接将是相对的而不是绝对的。所以你可以将DLL和更新的VS项目签入你的配置管理中,每个人都应该能够共享它。

If you copy the DLL to a folder inside your VS solution folder before linking to it, I think the project link will be relative not absolute. So you can check the DLL and the updated VS project into your configuration management and everyone should be able to share it.

一杯敬自由 2025-01-11 16:34:05

您应该开始使用虚拟路径进行开发工作;这样,每个团队成员都可以将与工作相关的文件保存在除虚拟路径之外的任何物理位置(工具看到的位置始终相同。

例如,我的团队在 Q:\ 下完成所有工作。我的工作物理源位于物理路径 C:\Work\ 下,其中 project_name 部分取决于项目。当我想要处理给定项目时,我会映射 Q:\ 使用虚拟路径到正确的物理路径

subst q: c:\work\project_name

当我需要时 开关,我运行类似的命令,这样就不必担心不同计算机上的不同路径,这对整个团队来说非常有效,并且消除了您上面描述的大多数问题。 相关的文件时,使用虚拟路径(Q:),而不是物理路径。对于我的团队来说,花了大约一周的时间来适应,之后就没有更多的问题了。

在处理与项目 您的项目的因此在源代码控制工具中忽略它最终将导致问题。我建议你不要这样做(即使你可以)。

编辑
如果 DLL 位于不同计算机上的不同物理文件夹中,则最佳选择是将这些 DLL(及其依赖项)复制到已知位置。只要编译器找到它们,它们就不能从那里运行也没关系。

这个已知位置可能位于您的虚拟路径或公共物理路径内(如果多个项目需要相同的 DLL)。您可以使用 Dependency Walker 来确定本机 DLL 和 .NET DLL 的反射器

如果 DLL 的大小/数量太大以至于无法创建副本,您实际上可以告诉 AnkhSVN 在提交更改时忽略某些版本控制的文件。右键单击该文件,选择 Subversion >移至更改列表>提交时忽略。此后,该文件将在提交对话框中显示为未选中状态,但如果您手动选择它,您仍然可以提交它。

You should start using virtual paths for development work; that way each team member can keep work-related files at any physical location but the virtual path (the one seen by tools is always the same.

For example, my team does all work under Q:\. My physical source for work is under physical path C:\Work\<project_name> where the project_name part depends on the project. When I want to work on a given project, I map the Q:\ virtual path to the right physical path using

subst q: c:\work\project_name

When I need to switch, I run a similar command. This way there's no need to worry about different paths on different computers. This worked very well for the whole team and eliminated most issues you describe above. The only thing you need to make sure is that everyone always uses the virtual path (Q:), not the physical path when dealing with project-related files. For my team it took about a week to get used to that, after that there were no more problems.

Your project file is an important part of your project so ignoring it in the source control tool will eventually lead to problems. I recommend you don't do it (even if you can).

Edit:
If you have DLL-s in different physical folders on different machines, the best choice is to copy those DLL-s (and their dependencies) to a known location. It's fine that they can't run from there, as long as the compiler finds them.

This known location could be inside your virtual path or a common physical path (if the same DLL-s are needed for multiple projects). You can use Dependency Walker to determine what dependencies you need for native DLL-s and Reflector for .NET DLL-s.

If the size/number of DLL-s is so large that creating a copy is not an option, you can actually tell AnkhSVN to ignore certain versioned files when committing changes. Right-click the file, select Subversion > Move to Change List > ignore-on-commit. After this the file will show up in the commit dialog unselected but you can still commit it if you manually select it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文