I can't seem to get Entity Framework 6.0.1 to install on a couple of F# projects I have. This is the error message I'm getting:
Executing script file 'C:\source\payboard\PayboardWeb\packages\EntityFramework.6.0.1\tools\install.ps1'. Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAProject' in assembly 'FSharp.ProjectSystem.Base, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At C:\source\payboard\PayboardWeb\packages\EntityFramework.6.0.1\tools\EntityFramework.psm1:633 char:5 + $domain.SetData('project', $Project) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : SerializationException
System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.Entity.ConnectionFactoryConfig.InitializeEntityFrameworkCommand.Execute() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
It seems like there's an open bug for it on the EF6 forums (https://entityframework.codeplex.com/workitem/891), but it hasn't gotten any love, so far as I can tell.
EF6 installs just fine on non-F# projects.
Any suggested workarounds?
EF Core does not support the EDMX file format for models. The best option to port these models, is to generate a new code-based model from the database for your application.
Keep using EF6 if the data access code is stable and not likely to evolve or need new features. Port to EF Core if the data access code is evolving or if the app needs new features only available in EF Core. Porting to EF Core is also often done for performance.
This is getting unblocked in EF6.1. Here is the workitem.
Note that the issue here is not EF itself but how the package is being added to your project. This makes me think that until EF6.1 is released you could probably work around this issue by getting the package unzipping it and adding references to EF6 assemblies manually to your project. Then you would have to update your config accordingly. (You could also create a temp C# project add the EF6 NuGet package which will give you the EntityFramework and EntityFramework.SqlServer dlls you could copy to your F# project and also a config file you could copy from which will be much easier than coming with the right configuration on your own)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With