Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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.

When there is no .csproj file and you have like "adduser.aspx.cs" files, Open VS->File->open->Website options and the from there browse to your folder and open the folder that opens your solution and you can run the project.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top