How important is the global.json and src folder?

前端 未结 3 2063
被撕碎了的回忆
被撕碎了的回忆 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:36

    1) Yes, for me I also had this issue and started with blank solution. Then my projects had issues referencing each others.

    2) For me it did not work without global.json. You also need to make sure the solution file points correctly to everything, like the global.json. The projects did not build and did not find each others for me otherwise.

    3) To get everything working I created a mvc core project first to get the global.json file. Then I renamed the scr folder to applicationname.web. Make sure to alter the solution file accordingly so it does not point wrong. Also you should update the project.json file. This way, all thou I wanted a blank solution like you, I created a default project and then altered it to how I wanted it, that worked for me.

    I will build my current app using Onion Architeture as a guideline. I see no issue doing this with core. This also means that I will build the IoC in a different project (probably named infrastructure.IoC) so that my web project does not contain references to projects containing implementations of interfaces that the web should not know about.

    Also, if you still have problems, I actually got local build and reference problems because I had resharper and I turned that off, then the reference problems between projects went away and I could build successfully.

提交回复
热议问题