I’m using Entity framework 4.3.1 installed by nuget in my .Net 4.0 class library project. In situation, when I call the “Enable-Migrations” command in PM console, I receive following exception:
Exception calling “LoadFrom” with “1” argument(s): “Nelze načíst soubor nebo sestavení file:///D:\
Users\DvoracekR\Documents\Visual Studio 2010\Projects\WebCameras\packages\EntityFramework.4.3.1\to
ols\EntityFramework.PowerShell.Utility.dll nebo jeden z jejich závislých prvků. Systém nemůže nalé
zt uvedený soubor.”
At D:\Users\DvoracekR\Documents\Visual Studio 2010\Projects\WebCameras\packages\EntityFramework.5.
0.0-rc\tools\EntityFramework.psm1:393 char:62
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $toolsPath Entity
Framework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodExceptionYou cannot call a method on a null-valued expression.
At D:\Users\DvoracekR\Documents\Visual Studio 2010\Projects\WebCameras\packages\EntityFramework.5.
0.0-rc\tools\EntityFramework.psm1:394 char:50
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNullException calling “CreateInstanceFrom” with “8” argument(s): “Typ System.Data.Entity.Migrations.En
ableMigrationsCommand ze sestavení EntityFramework.PowerShell, Version=4.3.1.0, Culture=neutral, P
ublicKeyToken=b77a5c561934e089 nelze načíst.”
At D:\Users\DvoracekR\Documents\Visual Studio 2010\Projects\WebCameras\packages\EntityFramework.5.
0.0-rc\tools\EntityFramework.psm1:418 char:31>+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I solved problem described above.
directory.
Now migrations are enabled correctly.