question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why i can't use EF Core 1.1 in full .NET Frameowrk Asp.Net Core app (net461)?

See original GitHub issue

I’ve upgraded packages to 1.1.0 version, installed SDK 1.1 and app works but i can’t make ef migration. I can show migrations list but i can’t create new one. I read that i should use Microsoft.AspNetCore.Razor.Tools.DotNet(preview4) instead of Microsoft.AspNetCore.Razor.Tools (previev2) but i can’t use new tools because they support netcoreapp1.0.

error: Package Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-preview4-final is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-preview4-final supports: netcoreapp1.0 (.NETCoreApp,Version=v1.0)

With prevoius version of tools (Microsoft.AspNetCore.Razor.Tools preview 2) i can show migrations list but when i try to create new one i get this exception:

System.InvalidOperationException: The current CSharpHelper cannot scaffold literals of type ‘System.Collections.Generic.Dictionary2[System.Reflection.PropertyInfo,System.Collections.Generic.List1[System.Tuple`2[System.Reflection.PropertyInfo,System.Type]]]’. Configure your services to use one that can. w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpHelper.UnknownLiteral(Object value) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateAnnotation(IAnnotation annotation, IndentedStringBuilder stringBuilder) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityTypeAnnotations(IEntityType entityType, IndentedStringBuilder stringBuilder) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityType(String builderName, IEntityType entityType, IndentedStringBuilder stringBuilder) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityTypes(String builderName, IReadOnlyList`1 entityTypes, IndentedStringBuilder stringBuilder) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.Generate(String builderName, IModel model, IndentedStringBuilder stringBuilder) w Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationsGenerator.GenerateMetadata(String migrationNamespace, Type contextType, String migrationName, String migrationId, IModel targetModel) w Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace) w Microsoft.EntityFrameworkCore.Design.MigrationsOperations.AddMigration(String name, String outputDir, String contextType) w Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.Execute(CommonOptions commonOptions, String name, String outputDir, String context, String environment, Action`1 reporter) w Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.<>c__DisplayClass0_0.<Configure>b__0() w Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) w Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)

Further technical details

EF Core version: 1.1.0 Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: Win 8.1 Visual Studio 2015 update 3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
enricoreichcommented, Dec 16, 2016

Maybe you should use Version 1.1.0-preview4-final instead of 1.0.0-preview4-final

Most NetCoreApp 1.1 compatible packages are labeled with minor version 1 (eg. 1.0.0 -> 1.1.0)

0reactions
AndrewTreadcommented, Dec 29, 2016

Fixed now. Many thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework Tools not working after update to EF ...
I have an ASP.NET Core application targeting the full .NET framework. Thus I need the net461 entry in the frameworks section of project.json ......
Read more >
can not upgrade from EF Core 1.1.2 to version 2.0.0
EF Core 2.0 release has been officially announced and the documentation is (partially) updated. Of course it's not NET Core only.
Read more >
Supported .NET implementations - EF Core
We want EF Core to be available to developers on all modern .NET implementations. EF Core's support on .NET for Windows, Linux, ...
Read more >
Please stop lying about .NET Standard 2.0 support!
NET Core 3.0 are now out of support. According to the original PR and this document about the change: Continuing to build for...
Read more >
Cannot start #2635 | Support Center - ASP.NET Zero
The error message is: The specified framework 'Microsoft.NETCore.App', version '1.1.0' was not found. Check application dependencies and target ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found