First of all, I would like to make it clear that I know that the src
folder is not required. Indeed, one can simply create manually one directory for the project, make one valid project.json
and one Startup
class and everything should work fine even without Visual Studio.
My point is the following: when we create a new project using ASP.NET 5 from Visual Studio 2015 it creates a solution and inside the solution's folder it creates one src
folder. Within this folder all projects are created.
Now why would anyone want to make one src
folder inside the solution folder? Why not putting the projects direct onto the solution folder? Is there any advange on the organization of the project to put the projects inside a src
folder? Why VS does that now?
The src stands for source. The /src folder comprises of the raw non-minified code. The /src folder is used to store the file with the primary purpose of reading (and/or editing) the code. The /src folder contains all the sources, i.e. the code which is required to be manipulated before it can be used.
The src directory contains all of the source material for building the project, its site and so on. It contains a subdirectory for each type: main for the main build artifact, test for the unit test code and resources, site and so on.
Describes the Java™ source tree. When you create an API project, it is set up as a Java project with separate folders for source and class files. The source folder is named src .
Creating a Solution NET will create a new solution with the same name as the project, placing the solution files in the same directory as the project. Although this works fine for small projects, it isn't well suited to more complex applications.
You usually have more files inside your project that are not source code related like:
And a tons of others files that depend on your configuration. So, if you have a src folder, you don't need to mix your source code files with those.
because you may have your code in src folder (class libraries, etc), test in your test folder, documentation in a documetation folder
in global.json you specify which folders does roslyn pick for compiling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With