I am deploying a new .NET Core application on my server. I am trying to start EntityFramework migration as the project was created using the "code-first" method.
Command to run
Dotnet ef database update
Migrations work locally using visual studio without problems, however on the server I get an error:
The version for Microsoft.EntityFrameworkCore.Tools.DotNet cannot be resolved.
Version on my DotNet 1.0.0 development machine
Version on my DotNet 1.0.1 server
My project uses the .csproj file (and not project.json, which is no longer used).
I added a link to the csproj file, but regardless of the version, I still get the above error.
<ItemGroup> <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" /> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" /> </ItemGroup>
Update
Basically I tried installing Microsoft.EntityFrameworkCore.Tools.DotNet from the command line using NUGET:
C: \ Program Files (x86) \ Jenkins \ workspace \ api.XXX.com \ XXXProject> nuget i nstall Microsoft.EntityFrameworkCore.Tools.DotNet
Then I get the following:
A WARNING. Installation error. Rollback ... Performing nuget actions took 13.44 seconds. The package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0' has the package type 'D otnetCliTool', which is not supported by the project 'C: \ Program Files (x86) \ Jenkins \ w orkspace \ api.XXX.com \ XXXProject'.`
Then, if I run the dotnet ef command, I get the following:
C: \ Program Files (x86) \ Jenkins \ workspace \ api.desully.com \ deSullyAPI_Core> dotnet ef update database
The version for Microsoft.EntityFrameworkCore.Tools.DotNet cannot be resolved.
Update # 2
I noticed that my dev machine has different versions of the SDK in it than the version on the server
Dev box 
Production box 
I assume the problem is that 1.0.1 does not have Microsoft.EntityFrameworkCore.Tools.DotNet in it? Isn't it weird what the old version does?
Update 3
So, fyi - I went to the Microsoft website to try to download version 1.0 of the SDK (since it did not seem to install on my server). Unfortunately, the MS site seems to be forcing me to download version 1.0.1 (which does not contain the EF file I need?).
I tried to copy the 1.0.0 file from my dev module to the production server, but that didn't work either. What am I missing here?