ChatGPT解决这个技术问题 Extra ChatGPT

View more than one project/solution in Visual Studio

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.

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?

If you're just looking for a faster way to access "File > Recent Projects and Solutions", you can create a custom toolbar or menu entry. Open "Tools > Customize", switch to the "Commands" tab, click "Add Command" and choose "File > Recent Project List". Put it wherever you want.
Projects possible but solutions in the same solution explorer not possible. Have to start a new instance. But in mac version of visual studio supports it.

D
Dennis G

This is the way Visual Studio is designed: One solution, one Visual Studio (VS) instance.

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.


Ok that makes sense. So in a nutshell you can nest projects within solutions. But you cannot have many solutions open at once. Thanks.
A solution is more or less like the workspace concept in Eclipse - you can't have two loaded in the same instance.
Mac version of visual studio supports opening multiple solutions in same solution explorer
With multiple projects, if I have multiple main() methods, how do I select which I want to have compiled?
@5Daydreams why not compile all? With the optimization what is compiled it doesnt really matter anyway if you order to compile unchanged stuff again. If you mean what to RUN, that is a different matter. Next to the green triangle u click to run stuff, there's a dropdown
N
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.


You can open another instance like any other program. On Windows <=7, open as normal. On Windows >=8, you'll have to either hold the shift key or toggle a global registry setting.
Middle click on the VS icon on the taskbar to launch a new instance if one is already up. It's also handy to pin frequently used solutions to the Jump List. Right clicking on the icon and selecting one of those will open it in a new instance instead of the current instance.
For OSX, right click on the VS icon in the dock and select "New Instance"
B
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.

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.


How can I open multiple instances of VS?
@SasukeUchiha Right-click on the icon in your task bar then click Visual Studio 20xx on the context menu, where xx represents whatever version of Visual Studio you have, i.e. 2012, 2013, 2017, 2019
K
Kevin Brown

There is a way to store multiple solutions in one instance of 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

https://i.stack.imgur.com/JaiH8.png

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.

NOTE: This worked for Visual Studio 2013 Professional


This is the correct answer to the OP's original question: view multiple solutions at once in the VS Solution Explorer. Verified this continues to work as described in VS 2017.
The question has two parts solutions and projects. For solutions, this is not correct. It will add the second solution projects to the first solution. So it modifying the first solution which is wrong. Recently I think this feature is available for mac version but not in windows version.
D
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.


This is categorical not what they asked.
K
Kris van der Mast

You can create a new blank solution and add your different projects to it.


A
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.


Try that with 100s of projects and see your build time for a solution tend towards infinity. It also clashes with git's philosophy of handling source control for multiple projects. This is a monolithic nightmare.
R
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}.


V
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 projects i.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/


q
quAnton

After a long research and different experiments the easiest way "FOR MAC USERS" is to create a script:

open -a "Visual Studio" \
"path to first sln" \
"path to second sln" \
...

:D


script automation saves the day once again :p. did this for windows (single batch script containing multiple cmds for multiple solutions like so stackoverflow.com/questions/44659275/…
L
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.


f
fizban

File -> New Window. Select the other project in that window. Each project lives in a separate window. You can tab between them.