visual-studio 与多个用户一起处理 Visual Studio 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41320/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:26:03  来源:igfitidea点击:

Working on a Visual Studio Project with multiple users?

visual-studio

提问by Michael Stum

I just wonder what the best approach is to have multiple users work on a Project in Visual Studio 2005 Professional.

我只是想知道让多个用户在 Visual Studio 2005 Professional 中处理一个项目的最佳方法是什么。

We got a Solution with multiple Class Libraries, but when everyone opens the solution, we keep getting the "X was modified, Reload/Discard?" prompt all the time. Just opening one project is an obvious alternative, but I find it harder to use as you can't just see some of the other classes in other projects that way.

我们得到了一个包含多个类库的解决方案,但是当每个人打开解决方案时,我们不断收到“X 被修改,重新加载/丢弃?” 一直提示。仅仅打开一个项目是一个明显的选择,但我发现它更难使用,因为你不能以这种方式看到其他项目中的其他一些类。

Are there any Guidelines for Team Development with VS2005 Pro?

是否有使用 VS2005 Pro 进行团队开发的指南?

Edit: Thanks. The current environment is a bit limited in the sense there is only 1 PC with RDP Connection, but that will change in the future. Marking the first answer as Accepted, but they are all good :)

编辑:谢谢。当前环境有点受限,因为只有 1 台带有 RDP 连接的 PC,但将来会发生变化。将第一个答案标记为已接受,但它们都很好:)

回答by Lasse V. Karlsen

What you need is source control.

您需要的是源代码控制。

You should definitely not open the same files over the network on multiple machines. For one thing, Visual Studio has safeguards in place to prevent you from modifying certain files during a build, but it has none of that that will prevent others from modifying the same files over the network.

您绝对不应该在多台机器上通过网络打开相同的文件。一方面,Visual Studio 有适当的保护措施来防止您在构建期间修改某些文件,但它没有任何措施可以防止其他人通过网络修改相同的文件。

By setting up source control, each developer will have a separate copy of the files locally on his or her developer machine, and periodically communicate with the source control system to check in/commit changes. After that, other developers can ask for the latest updates when they're ready to retrieve them.

通过设置源代码控制,每个开发人员将在他或她的开发人员机器上本地拥有一份单独的文件副本,并定期与源代码控制系统通信以签入/提交更改。之后,其他开发人员可以在准备检索最新更新时要求他们提供最新更新。

回答by Mark Ingram

Use source control to keep a central repository of all your code. Then each user checks out their own copy of the source code and works locally. Then submits only the code that changed.

使用源代码控制来保存所有代码的中央存储库。然后每个用户检查他们自己的源代码副本并在本地工作。然后只提交更改的代码。

https://en.wikipedia.org/wiki/Version_control

https://en.wikipedia.org/wiki/Version_control

回答by Vagnerr

A number of people have recommended using source control and I totally agree. However you also need do the following.

许多人建议使用源代码控制,我完全同意。但是,您还需要执行以下操作。

  • Exclude your personal options files from the repository (eg your .suo files)
  • Exclude your App.config files from the repository. - Not entirely but you need to have a Template.App.config. You commit that instead, and only copy your App.config into the Template.App.config when you make structural changes. That was each user has their own individual config for testing.
  • 从存储库中排除您的个人选项文件(例如您的 .suo 文件)
  • 从存储库中排除您的 App.config 文件。- 不完全,但你需要有一个 Template.App.config。您改为提交,并且仅在您进行结构更改时将您的 App.config 复制到 Template.App.config 中。那是每个用户都有自己的测试配置。

There are probably some other files worth excluding (obj directories and so forth) but thats all I can think of right now.

可能还有一些其他文件值得排除(obj 目录等),但这就是我现在能想到的。

Peter

彼得

回答by Daemin

This might sound snide, but if you're opening up the solution from a shared location then you're doing something wrong. If that's the case then you should start using source control (something like Subversion) and have everyone check out a copy of the project to work on.

这听起来可能很讽刺,但如果您从共享位置打开解决方案,那么您就做错了。如果是这种情况,那么您应该开始使用源代码控制(例如 Subversion),并让每个人都检查项目的副本以进行处理。

However if you're already using source control, then it might be a symptom of having the wrong things checked in. I find that you only need the sln, and the vcproj under source control.

但是,如果您已经在使用源代码管理,那么这可能是签入错误内容的症状。我发现您只需要 sln 和源代码管理下的 vcproj。

Otherwise I don't know...

不然我不知道...

回答by Rob Cooper

You should definitely, definitelybe working with source control!

绝对应该使用源代码管理!

This will help stop the collisions that are occurring. Also, if you are making changes to the shared projects this often that it isa problem, then also ensure that all code is tested before getting checked in(otherwise they may bust someone else's build), but make sure they check in often(or time gained from not dealing with prompts will be lost in merging conflicts) :)

这将有助于阻止正在发生的冲突。此外,如果您经常对共享项目进行更改,这一个问题,那么还要确保在签入之前测试所有代码(否则他们可能会破坏其他人的构建),但要确保他们经常签入(或不处理提示所获得的时间将浪费在合并冲突中):)