Answered Entity Framework Migrations Issue

  • martedì 6 marzo 2012 22:25
     
      Contiene codice

    I'm having an issue with EF Migrations, specifically with getting the "Enable-Migrations" command to work.  When I execute the command in the Package Manager Console I receive the following error:

        System.Management.Automation.PSArgumentException: Cannot find type System.Data.Entity.Migrations.MigrationsCommands]: make sure the assembly containing this type is loaded.
        at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
        Cannot find type [System.Data.Entity.Migrations.MigrationsCommands]: make sure the assembly containing this type is loaded.

    It seems to me that the NuGet console can't find the MigrationsCommands type from my EF assembly.  I've checked and the assembly is the most recent one (4.3.1), and from within object browser I am unable to find the MigrationsCommands type or namespace.  Anyway, any help on this would be greatly appreciated!

    Also, I have already checked both projects in my solution (it is a test solution simply to resolve the issue I am having).

    UPDATE: I still do not have a resolution, but it looks like the source of the issue is in the following output when I run the "Install-Package EntityFramework" command within the Package Manager Console. The error is here:

    Unable to find type [ConnectionFactoryConfiguratorInvoker]: make sure that the assembly containing this type is loaded. 
    At C:\...\packages\EntityFramework.4.3.1\tools\install.ps1:36 char:39
    + [ConnectionFactoryConfiguratorInvoker] <<<< ::Invoke((Join-Path $toolsPath "EntityFramework.PowerShell.dll"), $project)
    + CategoryInfo : InvalidOperation: (ConnectionFactoryConfiguratorInvoker:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound


    • Modificato jdscolam mercoledì 7 marzo 2012 19:16 Additional information
    •  

Tutte le risposte

  • mercoledì 7 marzo 2012 08:35
    Moderatore
     
     

    Hi jdscolam,

    Welcome!

    Do you mean you have solved the problem by recreating a simply project, right? 

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • mercoledì 7 marzo 2012 15:07
     
     

    Hi Chen,

    No, I mean I have a simple solution with two projects that re-creates the problem.  So even in a simple case I am still having the issue.  I have used the package management console pointed to both projects and both projects have the issue.

    Any ideas?

  • mercoledì 7 marzo 2012 19:16
     
     
    I have updated the original post with further information.
    • Contrassegnato come risposta jdscolam mercoledì 7 marzo 2012 20:21
    • Contrassegno come risposta annullato jdscolam mercoledì 7 marzo 2012 20:21
    •  
  • mercoledì 7 marzo 2012 20:21
     
     Con risposta
    After several hours of searching I have found the solution.  They key is located Here in Phil Haack's response to "Chris" regarding Reflector 6.5.  I had Reflector installed (version 7.0 curiously enough) and the Reflector Add-On enabled within VS2010.  Upon researching the NuGet FAQ I uninstalled Reflector and disabled the VS2010 Add-In.  This seems to have resolved the issue as I can now both "Install-Package EntityFramework" and "Enable-Migrations" without issue.
    • Contrassegnato come risposta jdscolam mercoledì 7 marzo 2012 20:21
    •