The problem of migration of objects

I have a problem with EF Migrations, in particular, so that the "Enable-Migrations" command works. When I execute the command in the package manager console, I get the following error:

System.Management.Automation.PSArgumentException: cannot find type System.Data.Entity.Migrations.MigrationsCommands]: make sure the assembly containing this type is loaded.
in 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 cannot find the MigrationsCommands type from my EF assembly. I checked and the assembly is the latest (4.3.1), and from within the object browser I cannot find the type or namespace of MigrationsCommands.

UPDATE: I still do not have permission, but it seems that the source of the problem is in the next release, when I run the “Install-Package EntityFramework” command in the package manager console, Error 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 
+4
source share
2 answers

After hours of searching, I found a solution. They are in here in Phil Haack's answer to "Chris" regarding Reflector 6.5. I have Reflector installed (version 7.0 is quite interesting), and the Reflector Add-On function is included in VS2010. After examining the NuGet FAQ , I uninstalled Reflector and disabled the VS2010 add-in. This seems to have solved the problem, since now I can both “Install-Package EntityFramework” and “Enable-Migrations” without any problems.

+2
source

Disable the add-in in VS2010 (Tools-Options-Environment-Add-In / Macros Security / Allow adding components to laod) Disable ReSharper if it is installed in VS2010 (Tools-Options-ReSharper-suspended)

Restart VS2010, the problem will be resolved.

0
source

Source: https://habr.com/ru/post/1399898/


All Articles