.NET Core解决方案和项目组织 [英] .NET Core solutions and projects organization

查看:84
本文介绍了.NET Core解决方案和项目组织的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

为仅.NET Core项目创建Visual Studio解决方案的正确/推荐方法是什么?

What is the correct/recommended way for creating a Visual Studio solution for only .NET Core projects?

选项1:

首先创建一个Visual Studio解决方案(其他项目类型-> Visual Studio解决方案),然后向该解决方案中添加几个项目(.NET Core类库,ASP.NET Core).我是什么看到以这种方式创建我的解决方案时,没有src文件夹 也不是global.json文件,...

Starting by creating a Visual Studio Solution (Other Project Types -> Visual Studio solutions) and adding several Projects (.NET Core Class Library, ASP.NET Core) to this solution. What I e.g. see when creating my solution this way there's no src folder nor a global.json file, ...

选项2:

创建一个项目(例如,.NET Core类库),还会创建一个解决方案(基于类库名称).在这里,我得到一个src文件夹和global.json文件.然后添加其他项目(其他.NET Core类 Lib或ASP.NET Core),可以通过创建它们 src 文件夹?

Creating a project (e.g. a.NET Core Class library), this creates as well a solution (based on the  Class Library name). Here I get an src folder and global.json file. Then adding the other projects (other .NET Core Class Libs or ASP.NET Core) by creating them in the src folder?

谢谢.

推荐答案

盖伊迪伦

创建.net核心项目(在.NET Core下)时,src文件夹和解决方案项目已添加到解决方案中.

但是,如果我们创建一个空白解决方案,并向其中添加.net核心项目,则其中没有src和Solution Items文件夹.这表明src和解决方案项不是.net核心项目中必不可少的.这些文件夹可以帮助我们进行管理 .net核心项目和解决方案.并且,如果将 un -.net核心项目添加到解决方案中,则该项目将不会添加到src文件夹中.

But if we create a Blank Solution, and add .net core project to it, there are no src and Solution Items folders in it. Which indicate that the src and Solution Items are not the essential in .net core project. These folders could help us manage .net core projects and solution conveniently. And if you add a un-.net core project to the solution, this project will not be added to src folder.

因此我们也可以将src和Solution Items文件夹手动添加到Blank Solution .同样的结果,当您为Blank Solution创建一个src文件夹,并向其中添加.net核心项目,然后创建第二个.net核心项目时, 并且第二个.net项目将通过默认添加到src文件夹中.然后,您将一个un.net项目添加到Blank解决方案中,该项目将被添加到src文件夹外部,就像.net核心解决方案一样.

So we could also add src and Solution Items folders to Blank Solution manually. The same results, when you create a src folder to Blank Solution, and add a .net core project to it, then you create the second .net core project, and the second .net project will be added to src folder by default. And then you add a un-.net project to the Blank Solution, this project will be added outside the src folder just like above .net core solution.

此致

奥斯卡


这篇关于.NET Core解决方案和项目组织的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆