[英]Add a project.json based project to a .sln file without using Visual Studio
We have developers that are using VS Code on Linux, Windows, and Mac. 我们的开发人员在Linux,Windows和Mac上使用VS Code。 We also have developers that are using full Visual Studio on Windows.
我们也有开发人员在Windows上使用完整的Visual Studio。 A problem arises when the former (including me) do not add their projects to the solution, and the latter therefor do not see the projects in the solution.
当前者(包括我)没有将他们的项目添加到解决方案中时会出现问题,而后者则不会在解决方案中看到项目。
How can developers add their project.json projects to a sln
without having to open Visual Studio? 开发人员如何将他们的project.json项目添加到
sln
而无需打开Visual Studio?
Nowadays .NET Core SDK allows working with sln files. 如今.NET Core SDK允许使用sln文件。
Imagine you have a root folder for the solution. 想象一下,你有一个解决方案的根文件夹。 All the projects are located under src and test folders.
所有项目都位于src和测试文件夹下。
Then from the solution folder run 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 the projects in the solution runing 您可以列出解决方案运行中的项目
dotnet sln list
Note: The solution provided above is not going to work with project.json files. 注意:上面提供的解决方案不适用于project.json文件。 Anyway project.json format is obsolete now and you can easilty migrage to csprojs with the latest SDK.
无论如何,project.json格式现已过时,您可以使用最新的SDK轻松迁移到csprojs 。 Just run in your project folder:
只需在项目文件夹中运行:
dotnet migrate
and you are good to go. 你很高兴。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.