Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast error #277

Closed
hugosmarques opened this issue May 16, 2017 · 3 comments
Closed

Cast error #277

hugosmarques opened this issue May 16, 2017 · 3 comments

Comments

@hugosmarques
Copy link

When i run:

dotnet ef dbcontext scaffold "Host=xxx.xxx.xxx.xxx;Port=3307;Database=xxxxxxxx;Username=xxxxx;Password=xxxxxxxxx" ^ Pomelo.EntityFrameworkCore.MySql ^ --force ^ --context "FooContext" ^ --output-dir "Entities" ^ --verbose

Get this error

System.InvalidCastException: Unable to cast object of type 'Microsoft.EntityFrameworkCore.Scaffolding.Internal.MySqlDesignTimeServices' to type 'Microsoft.EntityFrameworkCore.Infrastructure.IDesignTimeServices'.
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureDesignTimeServices(Type designTimeServicesType, IServiceCollection services)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContextAsync(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable1 schemas, IEnumerable1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.d__22.MoveNext()
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source, Int32& length) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass4_0`1.b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Unable to cast object of type 'Microsoft.EntityFrameworkCore.Scaffolding.Internal.MySqlDesignTimeServices' to type 'Microsoft.EntityFrameworkCore.Infrastructure.IDesignTimeServices'.

Can anyone help on this

@SilverioMiranda
Copy link

You are using version 2.0. * - pre that is incompatible with version 1.1.*

@hugosmarques
Copy link
Author

and when will be available the version for .net core 2?

@caleblloyd
Copy link
Contributor

You can use the 1.1.2 line with .net core 2.

We are working on a package that tracks EF Core 2 in #282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants