简体   繁体   English

将基于project.json的项目添加到.sln文件而不使用Visual Studio

[英]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.

相关问题 在Visual Studio中调试project.json命令 - debug a project.json command in visual studio 如何重定位 Visual Studio 项目 (.sln) 文件 - How to Relocate Visual Studio project (.sln) file 如何配置.sln Visual Studio Project文件存储在项目文件夹中? - How to configure .sln Visual Studio Project file to be stored in the project folder? 将没有.sln的项目从GitHub克隆到Visual Studio 2015中 - cloning a project without .sln from GitHub into visual studio 2015 Visual Studio不断更改project.sln文件 - Visual Studio keeps changing project.sln file 是否可以在不更新GUID的情况下在Visual Studio解决方案(.sln)文件中编辑项目路径? - Is it OK to edit the project paths in a Visual Studio solution (.sln) file without updating the GUIDs? 没有sln文件时使用Visual Studio 2015打开解决方案/项目 - Opening Solution / Project with Visual studio 2015 when there is no sln file 如何让Visual Studio 2015 xproject(project.json)引用依赖项目的最高框架 - How to let a Visual Studio 2015 xproject (project.json) reference the highest framework of a depending project 为什么我的project.json / xproj项目没有在Visual Studio 15(预览版)中打开? - Why does my project.json / xproj project not open in Visual Studio 15 (preview)? 从加载项中打开.sln文件,而无需重新加载Visual Studio - Open .sln file from add-in without reloading Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM