project.json Not Found in Visual Studio 2017 RC Solution Explorer

aspxsushil picture aspxsushil · Nov 20, 2016 · Viewed 24k times · Source

I did not find project.json in visual studio 2017 RC. Has this been removed in this version or am i missing something ? How do they store list of dependencies now if it is removed ?

Answer

svick picture svick · Nov 20, 2016

Going forward, .Net Core is going to be based on msbuild, which means that it's going to use *.csproj instead of project.json. Package references are now also stored in the *.csproj file.

For more information, read Announcing .NET Core Tools MSBuild “alpha” on the .NET Blog and High level overview of changes in CLI Preview 3 in .NET Documentation.

For example, if you had this in your project.json:

"dependencies": {
  "Microsoft.NETCore.App": {
    "type": "platform",
    "version": "1.0.0"
  },
  "Newtonsoft.Json": "9.0.1"
}

You will now have *.csproj containing:

<PackageReference Include="Microsoft.NETCore.App">
  <Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
  <Version>1.0.0-alpha-20161104-2</Version>
  <PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
  <Version>9.0.1</Version>
</PackageReference>