如何防止Visual Studio两次打开相同的解决方案 [英] How can you prevent Visual Studio from opening the same solution twice

查看:141
本文介绍了如何防止Visual Studio两次打开相同的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用VB2008和2010(以及2012年)作为我们的程序。



VS允许您在同一台PC上多次打开相同的解决方案。我们这样做是错误的,现在编辑相同的解决方案是VS的不同实例,这是我们不想做的。



VS6不允许这样做。 />


我们如何让VS.Net不允许或至少收到消息。



谢谢

We use VB2008 and 2010 (and going to 2012)for our programs.

VS let you open the same solution on the same PC multiple times. We do this by mistake and are now editing the same solution is different instances of VS which is we do not want to do.

VS6 would not allow this.

How can we get VS.Net to not allow it or at least get a message.

Thanks

推荐答案

我认为你不能。但Visual Studio所做的是,如果加载到当前项目中的任何文件正在打开的实例之外进行编辑,它会通知您。
I don't think you can. But what Visual Studio does is that it notifies you if any file loaded into current project is editing outside the opened instance.


您永远不需要它。如果不小心你做了这件事有什么大不了的?



但是,Visual Studio让你可以完全自由地并行打开不同或相同的解决方案。在某些情况下,这可能是一个至关重要的特征。一个原因是调试。您可以拥有一个包含多个应用程序的解决方案,并且应用程序在运行时进行通信。如何调试?最好的方法之一是:打开相同的解决方案两次在调试器下同时运行两个不同的应用程序。如果不可能,那么调试会更加困难。



甚至有些情况下你想同时调试同一个应用程序的两个实例,因为它扮演不同的角色,一个实例与另一个实例进行通信,一个是同一台机器,另一个是网络上不同的机器。你会如何调试它?



所以,你想要的对你来说是一个很大的伤害,而不是任何有用的东西。



-SA
You never need it. What's a big deal if accidentally you do this?

But instead, Visual Studio gives you full freedom in opening different or the same solution in parallel. In some cases, this can be a critically important feature. One reason is debugging. You can have a solution with more than one application, and the application communicates during runtime. How to debug is? One of the best ways is: open the same solution twice and run two different applications at the same time under the debugger. If it was impossible, debugging would be much, much more difficult.

There are even cases when you want to debug two instances of the same exact application at the same time, because it plays the different roles and one instance communicate to another one, one the same machine or a different one on a network. How would you debug it?

So, what you want would be a great harm to you, not anything useful.

—SA


这篇关于如何防止Visual Studio两次打开相同的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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