Notes by @rowanmiller
This affects just the 1.1.0-preview4 tools on apps that target full .NET (rather than .NET Core). I have not been able to find a way to workaround this with the latest tools preview.
The best option right now is to roll back to the 1.0.0-preview3 version of the Microsoft.EntityFrameworkCore.Tools.DotNet package. Fortunately, because of the way things are factored, you can keep using the 1.1 versions of all the other packages.
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
},
I've tried to delete the older SDK and runtime, but it doesn't solve the problem.
It's not possible to generate migrations with v1.1.0.
The website is building and running successfully.
EF Core version: 1.1.0
Operating system: Windows 10
Visual Studio version: VS2015
My project.json:
{
"dependencies": {
"TinyMapper": "2.0.8",
"Hangfire.Dashboard.Authorization": "2.1.0",
"Hangfire": "1.6.6",
"Hangfire.SqlServer": "1.6.6",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Owin": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.DependencyInjection": "1.1.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
},
"frameworks": {
"net461": {}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
If you want to use package manager console to run the migrations, Microsoft.EntityFrameworkCore.Tools is necessary, because this package only contains .ps1 files, located at:
%UserProfile%\.nuget\packages\Microsoft.EntityFrameworkCore.Tools\1.1.0-preview4-final\tools
Also ensure Microsoft.EntityFrameworkCore.Tools is referenced in the dependencies section of your project.json file. NuGet won't load the Package Manager Commands from the tools section.
If you want to use dotnet ef commands, you will need these packages too:
PM> Install-Package Microsoft.EntityFrameworkCore.Tools.DotNet 鈥揚re
PM> Install-Package Microsoft.EntityFrameworkCore.Design
"dependencies": {
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
],
"type": "build"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
}
},
More on the topic #7076
I have a similar problem Unrecognized option '--config'
Confirmed what we speculated in triage: this affects just the 1.1.0-preview4 tools on apps that target full .NET (rather than .NET Core). I couldn't find a way to workaround this with the latest tools preview.
The best option right now is to roll back to the 1.0.0-preview3 version of the Microsoft.EntityFrameworkCore.Tools.DotNet package. Fortunately, because of the way things are factored, you can keep using the 1.1 versions of all the other packages.
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
},
Clearing to re-discuss in triage. To me, this would probably be patch worthy, but I'm not sure that we are planning to patch the preview tooling.
This is fixed in dev (could become 1.1.0-preview5) and dev2 (will become 1.0.0-msbuild2).
@bricelam does just using preview3 for full .NET projects seem like the best workaround to you?
Yes, but it depends on Microsoft.NETCore.App 1.0 which is the problem we were trying to solve with the 1.1.0-preview4 release.
Using the nightly builds would solve both problems 馃槈
@bricelam - If CI passes. 馃槣
I have the same problem, and would love to try out the nightly build. Is it available on a feed?
Any idea when _1.1.0-preview5_ might come out?
Just edit project.json and change the tools back to 1.0.0-preview3.
It works with the latest EntityFrameworkCore (v1.1.0).
The nightly feed is available here.
@microef Thanks, I does work. But it also requires me (and all my devs) to install platform 1.0.0 (we're on 1.1.0), which I'd rather avoid.
@bricelam Thanks, I'll try it out!
@bricelam Working excellently in _1.2.0-preview4-22817_. Thanks!
Any new on this? In my case the proposed workarounds don't work, neither using the nightly builds nor downgrading the tools to 1.0.0-preview3. I'm really desesperated. I've lost two days with this and I always hit an end with an error, like this (unrecognized option --config) or this:
Could not load assembly 'Sales'. Ensure it is referenced by the startup project 'Sales'
That is absurd, as my app has only one project and is not a dll (it has also emitEntryPoint:true set).
This is my favourite one:
error: Package Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-preview3-final is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-preview3-final supports: netcoreapp1.0 (.NETCoreApp,Version=v1.0)
I've read it five times to get sure that in the second sentence is telling just the opposite of the first one.
Furthermore, commands are not working on the PMC anymore, no matter wich version of the tools I install, no matter if I restore the packages and if I restart the computer...
Is this a joke? I'm getting crazy with so many versions of everything and I only want to create a migration, it doesn't matter wich version of the tools I have to use... Is there a valid option nowadays? Is very far the next release of the tools? This seems a rabbit hole I can't scape... Please tell me what is the maximum version I can target to get this work.
@SocVi100, it looks like you got to the bottom it. Well done! x86 will be supported in the new MSBuild-based tooling (for best results, wait for version 1.0.0-msbuild3-final or use the feature work nightly feed).
@bricelam, thanks! It has been a hard way though...
I don't know yet where the "platform": "x86" setting came from. I didn't want to target any platform specifically but in some moment it "slipped in".
Anyway, I pity you all in the team, there has been too many changes on key aspects since the "vnext" started its road and that burns anybody a lot. I supose it may be hard to work with so many changing premises.
@bricelam
Package Microsoft.EntityFrameworkCore.Tools.DotNet 1.2.0-preview4-22878 is not compatible with net461
@AR1ES - Are you using project.json based project? If yes then you need to put Tools.DotNet package under "tools" node instead of "dependencies".
@smitpatel , thanks. Tools.DotNet was under tools section and under dependencies.
Hey,
After reading all this above I can still not figure out the problem or solution. We have this project.json file content:
{
"dependencies": {
"Microsoft.AspNetCore.Hosting": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
},
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net462": {}
},
"configurations": {
"TestDebug": {},
"TestRelease": {}
}
}
We get the error "Unrecognized option '--config' when we run the following CLI cmd from the cmd line console:
dotnet ef dbcontext scaffold "Server=
We are on Windows 10 (latest patches). VS 2015 (latest patches). We also have installed on the dev machine VS 2017 to play with it (Not clear if that somehow messed us up).
We tried rolling back to "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final" but get a message we do not have the 1.0.0 framework installed.
We looked for Microsoft.EntityFrameworkCore.Tools.DotNet 1.2.0-preview4-22878 but cannot find it in the nuget pkg list. Is it a daily build?
Any definitive ideas or help will be greatly appreciated.
P.S. Sorry to say, because we love .NET Core so far but this just feels like a mess that we cannot seem to get clarification on. We just cannot be expected to work our way through all these various versions, etc when we are supposedly doing an upgrade to a stable release. I know you guys are working hard and it is appreciated but sometimes it feels like we are back in dll hell from years ago, except now its packages, sdks and platforms with all different versions and endless possible combinations. Sorry just needed to get that out. I know it will get better.
@chassq, my working solution was to use 1.1.0-preview3-final.
I had a lot of different errors. Initially 1.1.0-preview3-finals did not work.
Try the following steps:
dotnet restoredotnet builddotnet ef dbcontext scaffold .......Thanks for the quick reply. Here is what we get now:
project.json
{
"dependencies": {
"Microsoft.AspNetCore.Hosting": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
},
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net462": {}
},
"configurations": {
"TestDebug": {},
"TestRelease": {}
}
}
Restored, cleaned and deleted bin/obj per above.
Ran the CLI cmd and get this:
The specified framework 'Microsoft.NETCore.App', version '1.0.0' was not found.
How should we go about installing the 1.0.0 version as specified in the message?
Thanks!
@chassq Install the LTS Runtime from the .NET Core Downloads page.
Thank you very much. That did the trick. Working again.
I got this error with "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final" but it went away if I used "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4"
@cda-1 That's interesting. Maybe because that version doesn't exist (doesn't show up in nuget package mgr) it's actually using the previous version 1.0.0-preview3-final?
I can no longer find 1.2.0-preview4-22817 anywhere, including on the dev-feed. Luckily I had i cached, so now I'm commiting it to my repo and adding a local nuget feed for this package only.
The version numbers are a bit confusing. Has this "fix" been released in some other version that I should switch to?
If anyone here is interested in trying out the latest (MSBuild/VS2017) tools, see #7358 for details.
We cannot roll back to '1.1.0-preview3-final' because it seems to be incompatible with current version of NuGet.
Help! Blocked on critical migration
Error: "The schema version of 'Microsoft.EntityFrameworkCore.Tools.DotNet' is incompatible with version 2.12.0.815 of NuGet"
@marchy Have you tried using a more recent version of NuGet? 2.12 seems very old, as 3.5 was recently released. (Or are you stuck with VS 2013?)
Same problem here ... I tried with different versions of _Microsoft.EntityFrameworkCore.Tools.DotNet_ and the problem always occured. I use VS 2015, Update 3.
Part of my project.json :
"dependencies": {
"Remotion.Linq": "2.1.1",
"Serilog.Sinks.RollingFile": "3.2.0",
"Serilog.Extensions.Logging": "1.4.0-dev-10136",
"System.Interactive.Async": "3.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.2",
"Microsoft.AspNetCore.Mvc": "1.1.3",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.2",
"Microsoft.AspNetCore.StaticFiles": "1.1.2",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1",
"Microsoft.Extensions.Configuration.Binder": "1.1.2",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.2",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2",
"Microsoft.Extensions.Logging.Console": "1.1.2",
"Microsoft.Extensions.Logging": "1.1.2",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.2",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.2",
"Microsoft.EntityFrameworkCore": "1.1.2",
"Microsoft.Extensions.Logging.Debug": "1.1.2",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.2",
"Microsoft.Extensions.Configuration.Json": "1.1.2",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.2"
},
"tools": {
"Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
},
"frameworks": {
"net461": {
"dependencies": {
[...]
}
}
},
After some tests I had to use the old version _1.0.0-preview3_ and it did the job.
Most helpful comment
Just edit project.json and change the tools back to 1.0.0-preview3.
It works with the latest EntityFrameworkCore (v1.1.0).