visual-studio 在 Visual Studio 中查看多个项目/解决方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4079278/
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
View more than one project/solution in Visual Studio
提问by Mike
I am new to visual studio and I am experimenting around with some Windows Services. I have created two solutions and I would like to view both of them at once. Without having to click file->recent projects to switch back and forth.
我是 Visual Studio 的新手,我正在尝试一些 Windows 服务。我创建了两个解决方案,我想同时查看它们。无需点击文件->最近的项目来回切换。
Ideally this could take place in the solution explorer and just nest the projects, but I am only able to view one solution/project at a time there.
理想情况下,这可以在解决方案资源管理器中进行并嵌套项目,但我一次只能在那里查看一个解决方案/项目。
Is there anyway to view multiple solutions/projects in Visual Studio?
无论如何要在 Visual Studio 中查看多个解决方案/项目?
回答by Dennis G
This is the way Visual Studio is designed: One solution, one Visual Studio (VS) instance.
这就是 Visual Studio 的设计方式:一个解决方案,一个 Visual Studio (VS) 实例。
Besides switching between solutions in one VS instance, you can also open another VS instance and open your other solution with that one. Next to solutions there are as you said "projects". You can have multiple projects within one solution and therefore view many projects at the same time.
除了在一个 VS 实例中的解决方案之间切换外,您还可以打开另一个 VS 实例并使用该实例打开其他解决方案。在解决方案旁边有你所说的“项目”。您可以在一个解决方案中包含多个项目,因此可以同时查看多个项目。
回答by Nik Reiman
There's a much easier (but not so obvious) way; right click on the Visual Studio icon in the taskbar, then right click on the application name in the popup menu, then click "Open". Windows will then open another instance where you can open another solution in.
有一种更简单(但不是那么明显)的方法;右键单击任务栏中的 Visual Studio 图标,然后右键单击弹出菜单中的应用程序名称,然后单击“打开”。然后 Windows 将打开另一个实例,您可以在其中打开另一个解决方案。
回答by Brian Driscoll
If you have two separate solutions, then you cannot view them simultaneously in the same VS instance. However, you can open multiple instances of VS and tab between them.
如果您有两个单独的解决方案,则无法在同一个 VS 实例中同时查看它们。但是,您可以打开 VS 的多个实例并在它们之间使用选项卡。
An alternative would be to import the projects from one solution into the other, thus putting all of your projects into one solution. You can do this by following these steps:
另一种方法是将项目从一个解决方案导入另一个解决方案,从而将您的所有项目放入一个解决方案中。您可以按照以下步骤执行此操作:
In the Solution Explorer, select the Solution into which you want to import a project. Right-click, and select Add->Existing Project from the context menu.
In the file chooser, find the project file that you want to import (it will end in .XXproj where XX is the language you're using).
Click Open and voila! Your project is imported.
在解决方案资源管理器中,选择要将项目导入其中的解决方案。右键单击,然后从上下文菜单中选择 Add->Existing Project。
在文件选择器中,找到您要导入的项目文件(它将以 .XXproj 结尾,其中 XX 是您使用的语言)。
点击打开,瞧!您的项目已导入。
回答by Kevin Brown
There is a way to store multiple solutions in one instance of VS.
有一种方法可以在 VS 的一个实例中存储多个解决方案。
Attempt the following steps:
尝试以下步骤:
- File > Open > Project/Solution
- This will bring up the open project window, notice at the bottom where it says options, select add to solution
- 文件 > 打开 > 项目/解决方案
- 这将打开打开的项目窗口,注意底部的选项,选择添加到解决方案
- Then select the file you want to add and click open
- This will then add the solution to your project. You still won't be able to run the same project in a single instance of VS, but you can have all your code organized in one place.
- 然后选择要添加的文件并点击打开
- 然后,这会将解决方案添加到您的项目中。您仍然无法在单个 VS 实例中运行同一个项目,但您可以将所有代码组织在一个地方。
NOTE: This worked for Visual Studio 2013 Professional
注意:这适用于 Visual Studio 2013 Professional
回答by Dhiraj Gupta
Just right click on the Visual Studio icon and then select "New Window" from the contextual toolbar that appears on the bottom in Windows 8. A new instance of Visual Studio will launch and then you can open your second project.
只需右键单击 Visual Studio 图标,然后从出现在 Windows 8 底部的上下文工具栏中选择“新窗口”。将启动 Visual Studio 的新实例,然后您可以打开第二个项目。
回答by Kris van der Mast
You can create a new blank solution and add your different projects to it.
您可以创建一个新的空白解决方案并将不同的项目添加到其中。
回答by Andy
You can have multiple projects in one instance of Visual Studio. The point of a VS solution is to bring together all the projects you want to work with in one place, so you can't have multiple solutions in one instance. You'd have to open each solution separately.
在一个 Visual Studio 实例中可以有多个项目。VS 解决方案的重点是将您想要处理的所有项目集中在一个地方,因此您不能在一个实例中拥有多个解决方案。您必须分别打开每个解决方案。
回答by Vectoria
Two ways come to mind...
想到了两种方法...
Open another visual studio window and open the second solution in it.
It would be preferable to add your existing projects to one solution, just right click and add existing project and navigate to the project file(csproj). .... e.g. C:\Users\User\Documents\Visual Studio 2012\Projects\MySqlWindowsFormsApplication1\MySql Windows Forms Project1\MySql Windows Forms Project1.csproj ....In this second way you might want to setup multiple start up projectsi.e. for people with client-server apps or apps with dependencies. ....To do this Select the solution then GoTo: Project>>Properties>>Startup Project>> Select Multiple Startup projects and set actions to Start. When you debug, the selected as start will run.
For interest sake you could open another multiple solution windows to view different projects at the same time. http://www.schwammysays.net/visual-studio-2012-tip-multiple-solution-explorers/
打开另一个 Visual Studio 窗口并在其中打开第二个解决方案。
最好将现有项目添加到一个解决方案中,只需右键单击并添加现有项目并导航到项目文件(csproj)。.... 例如 C:\Users\User\Documents\Visual Studio 2012\Projects\MySqlWindowsFormsApplication1\MySql Windows Forms Project1\MySql Windows Forms Project1.csproj ....在第二种方式中,您可能想要设置多个启动项目即对于具有客户端-服务器应用程序或具有依赖项的应用程序的人。....要做到这一点 选择解决方案,然后转到:项目>>属性>>启动项目>>选择多个启动项目并将操作设置为启动。调试时,选定的启动将运行。
出于兴趣,您可以打开另一个多个解决方案窗口以同时查看不同的项目。http://www.schwammysays.net/visual-studio-2012-tip-multiple-solution-explorers/
回答by RAINA
Don't know whether this is useful but if you want to work with multiple projects without navigating through projects tree {like multi window} you can try opening VS in another virtual desktop (at least it's possible for Windows 10) by holding Ctrl+win+D. Then open another VS studio and open your other project there. You can switch between projects by Ctrl+win+arrow key {left/right}.
不知道这是否有用,但是如果您想在不浏览项目树的情况下处理多个项目{如多窗口},您可以尝试通过按住 Ctrl+win 在另一个虚拟桌面中打开 VS(至少对于 Windows 10 是可能的) +D。然后打开另一个 VS 工作室并在那里打开你的另一个项目。您可以通过 Ctrl+win+箭头键 {left/right} 在项目之间切换。
回答by Luke Smith
MAC users - this issue was winding me up, as its not possible to open two different Visual Studio instances at the same time. Ive found a solution that works fine, though its a little unorthodox : get the latest beta testing version, which will install alongside your normal VS install in a separate sandbox (it does this automatically). You can then run both versions side by side, which is enough for what I needed - to be able to examine one project for structure, code etc., while doing the actual coding I need to do in the 'current' VS install instance.
MAC 用户 - 这个问题让我很头疼,因为它不可能同时打开两个不同的 Visual Studio 实例。我找到了一个工作正常的解决方案,尽管它有点不正统:获取最新的 beta 测试版本,它将与您的普通 VS 安装一起安装在一个单独的沙箱中(它会自动执行此操作)。然后,您可以并排运行这两个版本,这足以满足我的需要 - 能够检查一个项目的结构、代码等,同时在“当前”VS 安装实例中执行我需要执行的实际编码。


