Question

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.

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
Was it helpful?

Solution

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.

OTHER TIPS

Disable the Add-in within VS2010 (Tools-Options-Environment-Add-In/Macros Security/Allow Add-in components to laod) Disable the ReSharper if installed within VS2010 (Tools-Options-ReSharper-Suspended)

Restart VS2010, the issue will be resolved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top