177

Visual studio has always annoyed me because (to my knowledge) you cannot create a solution first and then add new/existing projects to it. The only way I know how to create a solution is to create a project and specify the solution name for it.

So, is there any way to start with a blank solution (.sln) in visual studio (any version)?

Allen Rice
  • 19,068
  • 14
  • 83
  • 115
  • 1
    I missed the "Blank Solution" option in VS2022, however, I fixed it by modifying my installation and adding a few other components/workloads. I __*guess*__ the option that I added that might have been the one that fixed it is the ".NET 5.0 Runtime". – aderchox Jan 14 '22 at 16:09
  • 1
    I too had this problem and I can confirm that the .NET 5.0 Runtime component restores the Blank Solution template. – Mark Jan 22 '22 at 17:10

9 Answers9

262

Yes, How to: Create Solutions and Projects gives an overview.

From the article:

Creating Solutions To create a new solution

  1. On the File menu, select New and then click Project.

  2. In the Project types pane, select Other Project Types and then select Visual Studio Solutions.

  3. In the Templates pane, select Blank Solution.

  4. Enter a name for the project.

  5. To change the location of the solution directory, choose Browse and specify a new location.

  6. Select Add to Source Control if you want to add the solution to a source control database or repository.

  7. Click OK.

After creating an empty solution, you can add new or existing projects and items to the empty solution by using the Add New Item or Add Existing Item command from the Project menu.

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
  • 9
    Thanks Justin, this helped me in 2017 too ! Don't know why they want to hide the blank/empty solution into such obscure place when many of us wants to start with blank solution and create folder structure as per tiers...Thanks – Milind Thakkar Sep 05 '17 at 06:50
  • 3
    Visual Studio 2019 does not allow you to create new projects via Add-new-Item. However you can add a new project via File->New->Project and type "project" after the word new on the control line. – Jonathan Jan 18 '19 at 00:00
  • 1
    awesome - search for "solution" and you find nothing.... thanks for provide workaround for microsoft fails :) – Puschie Mar 04 '20 at 09:04
  • 1
    Searching for "solution" will only return the 'blank solution' template when the language dropdown is set to 'All Languages'. This is dropdown is defaults to the last used selection (usually 'C#') – Lee Smith Aug 04 '21 at 09:59
  • still help me in 2021, a new blank solution help me only touch 3/51 csproj in my project, so I don't need to wait 30 min every time I hit F5 :D – Luke Aug 05 '21 at 12:28
  • Link is broken in August 2021 - Here is the new link - https://learn.microsoft.com/en-us/visualstudio/ide/creating-solutions-and-projects?view=vs-2019 – Brendan Sluke Aug 16 '21 at 00:56
  • 1
    Thanks @BrendanSluke just updated the answer to use your link. – Justin Ethier Aug 16 '21 at 14:26
  • Also works on VS2022. However the language must be set in English on first try. After creating one using English, it can be accessed when using other languages (Korean in my case). – Henry Kwon May 13 '22 at 02:21
45

In my case, with Visual studio 2022 the empty project template was missing entirely:

enter image description here

However, dotnet comes to the rescue with this handy command:

dotnet new sln

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new

enter image description here enter image description here

Related SO: How to create Solution file with dotnet core CLI

sommmen
  • 6,570
  • 2
  • 30
  • 51
31

For Visual Studio 2019 the steps are described in https://learn.microsoft.com/en-us/visualstudio/get-started/tutorial-projects-solutions?view=vs-2019#create-a-solution

  • Open Visual Studio.

  • On the start window, choose to Create a new project.

  • On the Create a new project page, enter blank solution into the search box, select the Blank Solution template, and then choose Next.

Note: You need to make sure you open a brand new project, right-clicking and create new project will not generate the option to create a blank solution.

enter image description here

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
  • 7
    This doesn't seem to work any more, at least not for me. There is no Blank Solution in the list any more, either from File > Create New Project or via the Start window... – Josh May 07 '21 at 15:05
  • 3
    there is no 'blank solution' option – Bassie May 27 '21 at 20:17
  • @Bassie, I've added an image, that is available on my machine – Michael Freidgeim May 28 '21 at 07:48
  • @MichaelFreidgeim I wonder if this is something that needs to be added via the vs installer? – Bassie May 28 '21 at 11:24
  • 8
    @Bassie I had the same problem. I could not find it by searching. But if I select _All languages_, _All platforms_ and _Other_, the _Blank Solution_ appears in the list. – Vegard Innerdal Jun 07 '21 at 06:05
  • 3
    @VegardInnerdal - to make it even more amusing, you need to leave the search box blank too. If you set All languages, All platforms and Other, and have a search of "Blank" or "Solution" the "Blank Solution" doesn't appear! – Boschy Jun 28 '21 at 01:03
  • +1 for the note. Yes it definitely work if you 1) open visual studio 2) 'select create new project' option. It doesn't work if you start visual studio without code and select New project from file menu. – Himanshu Mange Dec 23 '21 at 12:13
22

For Visual Studio 2013, it has changed slightly.
Searching 'Installed Templates (Ctrl + E)' for 'Blank' works, too.

To create an empty solution

  1. On the File menu, click New and then click New Project.
  2. In the left pane, select Installed, select Other Project Types, and then s elect Visual Studio Solutions from the expanded list.
  3. In the middle pane, select Blank Solution.
  4. Set the Name and Location values for your solution, then click OK.

http://msdn.microsoft.com/en-us/library/zfzh36t7.aspx

Shawn McGough
  • 1,980
  • 2
  • 22
  • 32
  • 4
    For me it was Installed > Templates > Visual Studio Solutions > Blank Solution – mallardz Jun 30 '14 at 09:39
  • 1
    +1 Been banging my head into a wall trying to find the blank solution option and searching for "Blank" worked. – kjw Jun 26 '15 at 18:25
  • 1
    For me it was Installed > Templates > Other Project Types > Visual Studio Solutions > Blank Solution – Deqing Nov 06 '15 at 03:50
  • You can get Blank Solution on Visual Studio 2019 via File->New->Project and type the word"solution" after the word "new" on the control line. – Jonathan Jan 18 '19 at 00:04
11

I fixed the missing "blank solution" problem in VS 2022 with Visual Studio Installer. My installer is not in english, so labels might be a little bit different. Sorry for my french english ;-)

In "Installation details", "Web dev with ASP.Net", "Optional", 8th checkbox "Items and projects templates for .Net Framework" (I can't imagine how this is related to the blank solution template... But i worked for me)

Rikou
  • 281
  • 3
  • 9
  • 5
    This worked for me too. It wasn't the 8th checkbox though, for me it was just the one labelled **Additional project templates (previous versions)**. – thisextendsthat Feb 16 '22 at 11:18
  • Just ran into this today, never ran into it before so I was totally lost.. thank you to Rikou and @thisextendsthat this was exactly my issue. Installing the "Additional project templates (previous versions)" option added it back in for me. – Aelarion Apr 02 '22 at 21:45
  • This fix the same problem for me. I also was "Additional project templates (previous versions)" checkbox – Mateusz Duda Feb 10 '23 at 11:01
8

If you are on VS2019, try this:

All Languages - All Platforms - Other

screenshot

SamB
  • 9,039
  • 5
  • 49
  • 56
Netguy
  • 81
  • 1
  • 2
5

visual studio 2022 red area needs to be marked.

enter image description here

ihsan güç
  • 241
  • 3
  • 7
0

For Visual Studio 2019 and 2022, I found this solution to work.

Warning!

  1. You will have to re-signIn and Launch Visual Studio several times if you see anything abnormal (like i did).
  2. And Update Visual Studio Installer to re-download .Net core and other version frameworks

Source of Solution :Visual Studio Dev Comminity

Launch Command line and browse to devenv.exe

C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe 

launch executable with following argument: /resetuserdata

or copy paste full command here.

C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe /resetuserdata
N_E
  • 743
  • 10
  • 16
0

A super easy way:
Create a text file with content:
(for vs 2012+)

Microsoft Visual Studio Solution File, Format Version 12.00

And save as .sln file.
You can open it as en empty solution now. And visual studio may will ask you to save the solution when you add new project in it, just cover it.

more sln header choose: https://gist.github.com/DanAtkinson/3f863464a5dadd93b8e4dea6fe7b973a