urfnet / URF.Core

Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight.
https://github.com/urfnet
MIT License
309 stars 62 forks source link

The current CSharpHelper cannot scaffold literals of type 'Microsoft.EntityFrameworkCore.Metadata.Internal.DirectConstructorBinding'. Configure your services to use one that can. #38

Closed vialeda closed 6 years ago

vialeda commented 6 years ago

Since the RC2 version until the official 1.0.0 I got a problem with the migration system with Visual Studio. Once I install the package I get this message when I add migration: The current CSharpHelper cannot scaffold literals of type 'Microsoft.EntityFrameworkCore.Metadata.Internal.DirectConstructorBinding'. Configure your services to use one that can. I do not have the error message if I use the RC1 version. Did you know what can be done to avoid this error?

Best regards, David

tonysneed commented 6 years ago

What version of the .NET Core SDK are you using?

vialeda commented 6 years ago

2.1.200

tonysneed commented 6 years ago

There's your problem. You need to install the SDK for .NET Core 2.1.3 ( currently in RC): https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1

tonysneed commented 6 years ago

URF.Core v1 depends on EF Core 2.1, which is now RC but will RTM any day now.

vialeda commented 6 years ago

I just finished the installation and I got the same error... Do I have to clear the cache of something?

tonysneed commented 6 years ago

@vialeda I thought of one more thing. You need to update your EF Core packages to 2.1 RC: https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/2.1.0-rc1-final

vialeda commented 6 years ago

Thank you tonysneed, I updated all other packages as well to the 2.1RC. It's now working. Thank you!!

tonysneed commented 6 years ago

My pleasure!