Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Visual Studio Solution File from the Command Prompt

Today I was in the Windows Command Prompt after doing a git clone https://...MySolution.git and wanted to open the .sln (i.e., solution file) from the new directory of the cloned repo.

What is the command to open this new solution in Visual Studio? Suppose the relative path is /MySolution/MySolution.sln

like image 740
Eric D. Johnson Avatar asked Jun 20 '17 17:06

Eric D. Johnson


People also ask

How do I open a visual command prompt?

To open the terminal: Use the Ctrl+` keyboard shortcut with the backtick character. Use the View > Terminal menu command. From the Command Palette (Ctrl+Shift+P), use the View: Toggle Terminal command.


2 Answers

If you haven't done cd MySolution but are still in the directory from which you did the git clone just type

start MySolution/MySolution.sln and hit Enter.

This will open whatever version of Visual Studio you currently have set to open with .sln files in Windows.

like image 79
Eric D. Johnson Avatar answered Sep 18 '22 18:09

Eric D. Johnson


If you don't mind using PowerShell, you should try WhatsNew. Once installed, you can just type sln to open the solution file in that directory.

like image 30
Nick Spreitzer Avatar answered Sep 18 '22 18:09

Nick Spreitzer