11

Closed

NuGet Package install fails with F# projects

description

Reported via blog - http://blogs.msdn.com/b/adonet/archive/2012/12/10/ef6-alpha-2-available-on-nuget.aspx?CommentPosted=true#10394085

I got the following exception, doesn't look like a major issue but want to update. I am writing my code in F# if that has anything to do with it.

PM> Install-Package EntityFramework -Pre

You are downloading EntityFramework from Microsoft, the license agreement to which is available at go.microsoft.com/fwlink. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.

Successfully installed 'EntityFramework 6.0.0-alpha2'.

Successfully added 'EntityFramework 6.0.0-alpha2' to DALEntities.

Exception calling "CreateInstanceFrom" with "8" argument(s): "Type 'Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAProject' in assembly

'FSharp.ProjectSystem.Base, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable."

At C:\Users\shashi\SkyDrive\Code\CommonDAL\packages\EntityFramework.6.0.0-alpha2\tools\install.ps1:10 char:5
  • $appDomain.CreateInstanceFrom(
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : SerializationException
Type 'get-help EntityFramework' to see all available Entity Framework commands.

PM>
Closed Jan 23 at 9:43 PM by mgirgin
Package install now works fine. I'll be doing some additional verification on actually using EF with F#

comments

BriceLambson wrote Feb 21, 2013 at 4:41 PM

Fixing this may depend on Work Item 597.

RoMiller wrote Feb 21, 2013 at 10:33 PM

EF Team Triage: We should try and fix this in EF6

CadErik wrote Jul 5, 2013 at 2:52 PM

Same issue here with EF 6.0.0-beta1

M> Install-Package EntityFramework -Version 6.0.0-beta1
'EntityFramework 6.0.0-beta1' already installed.
Adding 'EntityFramework 6.0.0-beta1' to JobManagementLogic.
Successfully added 'EntityFramework 6.0.0-beta1' to JobManagementLogic.
Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAProject' in assembly 'FSharp.ProjectSystem.Base,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable."
At C:\Users\erik\Documents\Visual Studio 2010\Projects\JobManager\packages\EntityFramework.6.0.0-beta1\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)
Install-Package : Object reference not set to an instance of an object.
At line:1 char:1
  • Install-Package EntityFramework -Version 6.0.0-beta1
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Install-Package], RuntimeException
    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
PM>

smithkl42 wrote Oct 18, 2013 at 11:32 PM

Same issue here with EF 6.0.1. I can't get EF to install from NuGet on F# projects. Any suggested workarounds?

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

happyrabo wrote Oct 22, 2013 at 4:51 PM

So, known issue since Alpha 2, and the RTM version still doesn't have a fix? Thanks a lot.

smithkl42 wrote Oct 23, 2013 at 4:14 PM

Unfortunately, F# seems to be an "also-ran" in the MS family of languages. Some five years on and it still doesn't have refactoring support; I ran into all sorts of issues getting F# projects to build on Microsoft's public TFS server; and I'm guessing from this bug getting through that the good folks managing the Entity Framework apparently never touch the language. Oh well. Functional programming, we hardly knew ye.

mwilson1 wrote Nov 21, 2013 at 4:45 PM

Voted. Broken with v6.0.1. Even a suggested workaround would be nice.

lukew wrote Nov 22, 2013 at 5:48 PM

We should update our Nuget package install to detect that it is installing in an F# project and not run the powershell scripts in this case. If we don't run the powershell scripts we the dependencies and upgrade scenarios would not be changed, but it would unblock F# users.

This would be an easy fix to unblock this scenario.

In the interim, users can extract EntityFramework.dll from the Nuget package file and add manually references to the components that they need.

RustamGuseynov wrote Dec 11, 2013 at 7:02 AM

Same problem

ajcvickers wrote Jan 14 at 11:10 PM

Fixed in: d67947314516

Dumb package for sharp people... (891: NuGet Package install fails with F# projects)

Solution is to check that the VS project has a CodeModel (which F# doesn't, but we use when doing app.config/references stuff) and if not then allow the package to install without trying to do any app.config/references stuff.

mgirgin wrote Jan 15 at 12:38 AM

YAY!