Why some UWP projects has project.json some doesnt has?

不想你离开。 提交于 2019-12-12 22:03:30

问题


I can see that some UWP projects has project.json file and all the NuGet packages entries are included in the project.json. But some UWP projects doesnt has project.json. NuGet packages entries are included in .csproj file itself. Why?


回答1:


In earlier stages of developing .NET Core tooling project.json (developed by ASP.NET Core team) was seen as a better way to manage NuGet packages, but later decision was made to move back to .csproj for various reasons. So now UWP is storing references to packages in .csproj since it's using .NET Core as well. You can read more here and here.

EDIT:

If I understand correctly, managing packages in .csproj requires Visual Studio 2017, and VS 2015 only understands project.json. That is why, by default, if you create UWP project in VS 2017 it will add project.json to be backwards compatible with VS 2015 (unless you target Creators Update which isn't supported by 2015 anyway).

However, even if you create a project without project.json in VS 2017 and lower its TargetPlatformVersion, it will still work, but only in VS 2017. So to decide to use project.json or not, you should simply decide whether you want to support VS 2015 or not.

This discussion might clear it more.



来源:https://stackoverflow.com/questions/44916856/why-some-uwp-projects-has-project-json-some-doesnt-has

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!