20

Is project.json going away and web.config coming back in ASP.NET Core 1.0?

In the roadmap document, the update in '16 Q4 or '17 Q1, they mention "replacing .xproj/project.json with .csproj/MSBuild".

Does that mark the end of project.json?

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Sam
  • 26,817
  • 58
  • 206
  • 383

1 Answers1

30

Update: As of Visual Studio 2017 and the latest dotnet CLI, project.json is officially dead. Visual Studio will migrate projects automatically, and there is a comparison chart here: https://learn.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj

project.json is indeed going away. As part of a future update to the .NET Core tooling, .xproj/project.json will be merged back into .csproj. However, the team has stated:

The new MSBuild will not have a complete list of every file, so that should reduce the size of the build file. It will still be XML, but the team is committed to making that experience better for all .NET projects. This will be an enhanced MSBuild that has all of the best parts of project.json

So, project.json will be deprecated, but some of the innovations such as auto-discovery of source files will stick around. They've also committed to improving the MSBuild experience given that many people voiced their opinion about this change.

web.config is a different thing entirely. It's used when hosting ASP.NET Core projects on IIS, but otherwise is not required.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
  • 8
    What a shame that they're going back to XML – Sam Jul 23 '16 at 00:44
  • 5
    @Sam Yeah, I liked project.json too. I'm hopeful that they'll deliver on their promise to keep most of the best parts around. – Nate Barbettini Jul 23 '16 at 00:46
  • 9
    Choice between JSON and XML is largely a matter of (bad) taste. XML is verbose and JSON lacks comments; pick your poison. Another reference for the project.json deprecation is https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/ – user7610 Oct 05 '16 at 17:44
  • 1
    @NateBarbettini will it be deprecated for all kind of projects? eg. _NetStandard_ projects or only [_.NET Core_](https://blogs.msdn.microsoft.com/dotnet/2016/07/15/net-core-roadmap/)? Nuget 3.x [supports](https://docs.nuget.org/ndocs/schema/project.json) `project.json`, will they stop supporting it? Are there any chances that `project.json` will just replace `packages.config`? I can't find any resource. – polkduran Dec 06 '16 at 14:45
  • 1
    @polkduran According to the .NET team, `project.json` will be completely deprecated for all project types. https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/ – Nate Barbettini Dec 06 '16 at 16:52
  • I'm getting an error from CocosCreator saying the project.json is invalid, is this why? And if so, how I can I fix that? – AustinWBryan Apr 14 '18 at 02:56
  • 1
    @AustinWBryan That's different enough that you should ask a separate question. – Nate Barbettini Apr 14 '18 at 16:03
  • 1
    @Sam Why? XML is far more powerful than JSON and can contain comments, making it much more readable (if you don't put a load of complex unnecessary stuff in there of course). The desire to switch to JSON seems to be nothing more than a fad with no real rationale behind it. – Jez Aug 13 '19 at 10:47
  • @Jez Why do you think XML is far more powerful than JSON? What can you do with it that you can’t do with JSON? My primary reason for not liking it is its verbosity. – Sam Aug 13 '19 at 20:48
  • 1
    It's not that verbose. The only slightly verbose thing about it is the surrounding tags. It's more powerful, I'd say, primarily because of attributes. Yeah you can do the equivalent with JSON (for example JDT instead of XDT, although JDT transforms aren't as powerful) but it doesn't look so good. You can represent data as 1s and 0s if you want. I think XML gives a good balance of expressiveness and readability. I grant you that MS have made some REALLY ugly XML in the past like those horrible complex WCF configurations, but that's not an inherent problem with XML. – Jez Aug 13 '19 at 21:14