简体   繁体   English

.sln 文件中专用“解决方案项”项目的目的

[英]Purpose of a dedicated "Solution Items" project in .sln file

I was looking at the .sln file generated from the template at https://github.com/ardalis/CleanArchitecture , and noticed there is this part:我正在查看从https://github.com/ardalis/CleanArchitecture的模板生成的.sln文件,并注意到有这部分:

Project("{UUID-1}") = "src", "src", "{UUID-2}"
EndProject
Project("{UUID-1}") = "tests", "tests", "{UUID-3}"
EndProject
...
Project("{UUID-1}") = "Solution Items", "Solution Items", "{UUID-4}"
    ProjectSection(SolutionItems) = preProject
        .editorconfig = .editorconfig
    EndProjectSection
EndProject

What exactly is the purpose of the "Solution Items" project? “解决方案”项目的目的究竟是什么? Does it cause the files listed (eg the default .editorconfig ) to be treated in some special way?它是否会导致以某种特殊方式处理列出的文件(例如默认的.editorconfig )? Do I need to add any new solution-related file (eg .stylecop.json ) to this list?我是否需要在此列表中添加任何新的解决方案相关文件(例如.stylecop.json )?

What exactly is the purpose of the "Solution Items" project? “解决方案”项目的目的究竟是什么?

It's not really a project but a pseudo folder in the Solution Explorer.它不是真正的项目,而是解决方案资源管理器中的伪文件夹。 You can create one yourself:您可以自己创建一个:

  • Right-click the solution, Add, New Solution Folder.右键单击解决方案,添加,新建解决方案文件夹。 Then type a name.然后键入名称。

So the purpose is to organize your files and avoid cluttering the Solution Explorer root folder.因此,目的是组织您的文件并避免使解决方案资源管理器根文件夹混乱。

Note that it is not a real physical folder, just a pseudo folder in the SE window.注意它不是真正的物理文件夹,只是 SE window 中的一个伪文件夹。 You can drag files and folders into it.您可以将文件和文件夹拖入其中。

You could, for instance, drag Test projects from different sections of your solution together in a Tests folder.例如,您可以将解决方案的不同部分中的测试项目一起拖到测试文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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