How important is the global.json and src folder?

前端 未结 3 2065
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 10:10

In VS 2015, when you create a new MVC 6.0 application using this approach:

File-->New-->Project-->ASP.NET Web Application-->ASP.NET 5 Preview Templat         


        
3条回答
  •  名媛妹妹
    2021-02-19 10:30

    As you've noted, this seems to be the new way of creating solutions when targeting ASP.NET 5. The global.json file specifies some solution-level settings. In particular, it defines the DNX runtime settings.

    I've seen two approaches to the src / test folder structure. If you look at what the MVC team is doing, they incorporate the src / test folders into the repository root. Many projects on, e.g., Github have a src directory in the root. So as long as you're OK with your global.json and solution files in the root of your project, it seems to align well with existing practices.

    If you look at what the .NET team is doing with the .NET 5 Core Framework, you'll see a similar pattern, albeit without the global.json file. Many of their libraries have src and tests subdirectories.

    I am going to try to pattern my projects after what the MVC team is doing for the time being, until I have a better understanding of .NET 5, DNX, and the rest. It does impose a certain structure on your projects, but then so did VS 2013 and .NET 4.5.

提交回复
热议问题