Reputation: 19446
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)?
Upvotes: 193
Views: 118955
Reputation: 2843
Not really what OP is asking for, but might help someone, since it's so easy in VS2022.
.sln
) for an existing project (.csproj
).csproj
fileUpvotes: 0
Reputation: 441
You can do it from command line tool in Dot Net Core:
c:\[your path to source folder]> dotnet new sln --name MySol1
Upvotes: 0
Reputation: 34642
Thirteen years later. It's finally there. (Or: back. Since it's VS 2022)
Upvotes: 4
Reputation: 1177
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
Upvotes: 1
Reputation: 787
For Visual Studio 2019 and 2022, I found this solution to work.
Warning!
- You will have to re-signIn and Launch Visual Studio several times if you see anything abnormal (like i did).
- 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
Upvotes: 0
Reputation: 310
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)
Upvotes: 11
Reputation: 7648
In my case, with Visual studio 2022 the empty project template was missing entirely:
However, dotnet comes to the rescue with this handy command:
dotnet new sln
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new
Related SO: How to create Solution file with dotnet core CLI
Upvotes: 54
Reputation: 134227
Yes, How to: Create Solutions and Projects gives an overview.
From the article:
Creating Solutions To create a new solution
On the File menu, select New and then click Project.
In the Project types pane, select Other Project Types and then select Visual Studio Solutions.
In the Templates pane, select Blank Solution.
Enter a name for the project.
To change the location of the solution directory, choose Browse and specify a new location.
Select Add to Source Control if you want to add the solution to a source control database or repository.
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.
Upvotes: 295
Reputation: 91
If you are on VS2019, try this:
All Languages - All Platforms - Other
Upvotes: 9
Reputation: 28473
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.
Upvotes: 31
Reputation: 2040
For Visual Studio 2013, it has changed slightly.
Searching 'Installed Templates (Ctrl + E)' for 'Blank' works, too.
To create an empty solution
http://msdn.microsoft.com/en-us/library/zfzh36t7.aspx
Upvotes: 22