I want to open a project in Visual Studio 2012 and I am looking at the source folder, but it does not have a solution file. The project looks like a class library project and it has one .csproj file and everything else is .cs files.
I am not sure how to open this project.
Any suggestions?
Double-click the .csproj file. Visual Studio will open the project file, regardless if it's not part of solution. A solution is not mandatory.
Microsoft has provided tool called SlnGen. You can use it to generate the solution file. It’s very simple to install and use. It works pretty well with multiple projects as well. Once the sln file is generated, you can open the project(s) using this sln file.
Installation: open command prompt and run the below command.
dotnet tool install --global Microsoft.VisualStudio.SlnGen.Tool
Command to generate the sln file.
slngen --launch:false --folders:true --collapsefolders:true --solutiondir:src --solutionfile:MySolution.sln --ignoreMainProject --verbosity:normal **.csproj
You can find the documentation here and GitHub repo here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With