Where Project.json tools should go now?

.net .net-core entity-framework-core nuget

Question

I'm following Entity Framework Core instructions step by step. At some point it says to

locate the tools section and add the Microsoft.EntityFrameworkCore.Tools.DotNet package as shown below

project.json:

"tools": {
   "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final",
   "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
   "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
 },

As I understand, project.json is gone now. So where am I supposed to add this value? Project file?

1
4
12/29/2016 5:01:38 PM

Popular Answer

In the project.json/xproj format, it goes at the top-level in project.json: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json#tools

In the new csproj system, it's represented by DotNetCliToolReference. There's basically no documentation for this that I could find; I only found it by reading the source of dotnet-migrate.

An example of that looks like this:

<Project ...>
  <Import .../>
  <PropertyGroup .../>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet">
      <Version>1.0.0</Version>
    </DotNetCliToolReference>
  </ItemGroup>
</Project>

A more complete example of the output of dotnet-migrate is here.

6
12/29/2016 6:59:33 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow