asp.net core mvc - How important is the global.json and src folder? -
in vs 2015, when create new mvc 6.0 application using approach:
file-->new-->project-->asp.net web application-->asp.net 5 preview templates
you end have following file structure on disk:
- artifacts
- src
- myproject.sln
- global.json
instead if decide create blank solution first so:
file-->new-->project-->other project types-->visual studio solutions-->blank solution
and start adding new asp.net web application project solution; end having file structure doesn’t have global.json
file , no src
folder.
according documentation, the global.json file used configure solution whole. includes 2 sections, projects , sdk default.
the projects
property designates folders contain source code solution. default project structure places source files in src folder, allowing build artifacts placed in sibling folder, making easier exclude such things source control.
the sdk
property specifies version of dnx (.net execution environment) visual studio use when opening solution. it’s set here, rather in project.json, avoid scenarios different projects within solution targeting different versions of sdk.
question 1)
as mentioned above, if choose first create blank solution, won’t having global.json
file.
is not having global.json
file impact application’s behavior in shape or form? example when deploy or interaction build artifacts?
question 2)
if have impact, should manually creating global.json
file?
question 3)
as of writing, there recommended approach creating multi-layered application in asp.net 5?
should first create mvc project , start adding class libraries project?
or
should first start creating blank solution , start adding class libraries , web application solution (knowing won’t have global.json
file nor src
folder)?
as you've noted, seems new way of creating solutions when targeting asp.net 5. global.json file specifies solution-level settings. in particular, defines dnx runtime settings.
i've seen 2 approaches src / test folder structure. if @ mvc team doing, incorporate src / test folders repository root. many projects on, e.g., github have src directory in root. long you're ok global.json , solution files in root of project, seems align existing practices.
if @ .net team doing .net 5 core framework, you'll see similar pattern, albeit without global.json file. many of libraries have src , tests subdirectories.
i going try pattern projects after mvc team doing time being, until have better understanding of .net 5, dnx, , rest. impose structure on projects, did vs 2013 , .net 4.5.
Comments
Post a Comment