简体   繁体   中英

Git repo doenst contain a Solution(.sln) file. How can I get it to work?

When I clone the repo I want to add a C# project in visual studio. But I cant seem to build the project, since its not in a solution folder. How can I add an Solution folder to an already existing git repo consisting of some projects?

If your file structure is like:

.git/ Project1/Project1.csproj Project2/Project2.csproj You go to the project root, and run the following in your powershell prompt:

Create a new solution file

dotnet new sln

Add all csproj files to it

dotnet sln add (Get-Item **/*.csproj) You may now open the *.sln file directly within visual studio.

If your file structure is like:

.git/
Project1/Project1.csproj
Project2/Project2.csproj

You go to the project root, and run the following in your powershell prompt:

# Create a new solution file
dotnet new sln

# Add all csproj files to it
dotnet sln add (Get-Item **/*.csproj)

You may now open the *.sln file directly within visual studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM