Add project.json project to .sln file without using Visual Studio

We have developers who use VS Code for Linux, Windows and Mac. We also have developers who use the full Visual Studio for Windows. The problem arises when the former (including me) do not add their projects to the solution, and the latter do not see the projects in the solution.

How can developers add project.json projects to sln without having to open Visual Studio?

+6
source share
1 answer

Currently, the .NET Core SDK allows you to work with sln files.

Imagine you have a root folder for a solution. All projects are located in the src and test folders.

Then from the solutions folder do something like this:

 dotnet sln add ./src/Insurance.Domain/Insurance.Domain.csproj dotnet sln add ./test/Insurance.Domain.Tests/Insurance.Domain.Tests.csproj 

You can list projects when you run the solution.

 dotnet sln list 

Note: The solution above will not work with project.json files. In any case, the project.json format is outdated now, and you can facilitate porting to csprojs with the latest SDK. Just run in the project folder:

 dotnet migrate 

and you are good to go.

+6
source

Source: https://habr.com/ru/post/1011957/


All Articles