Why i can't use EF Core 1.1 in full .NET Frameowrk Asp.Net Core app (net461)?
See original GitHub issueI’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.List
1[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:
- Created 7 years ago
- Comments:5
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)
Fixed now. Many thanks!