Fehler bei Aktivierung-Migrationen
Ich bin neu mit EF und ich habe eine Fehlermeldung, wenn ich versuche, führen Sie " Enable-Migrationen in der PMC-Konsole :
Ausnahme beim aufrufen von "LoadFrom" mit "1" argument(s):
"Could not load file or assembly 'file:///...\pa
ckages\EntityFramework.6.0.1\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At ...\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:780 char:62
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression.
At ...\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:781 char:50
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///...\packages\EntityFramework.6.0.1\tools\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is no t supported. (Exception from HRESULT: 0x80131515)"
At ...\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:809 char:31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich lief einfach in diesem auf einer meiner co-Arbeiter auf die Maschine. Die Lösung war:
So openn die Lösung Ordner in Datei-explorer, können Sie finden .dlls, die Sie suchen in "Packages" Ordner, dann EntityFramework 6.0.1 Ordner? Wenn nicht, gibt es zwei Möglichkeiten:
Ich hatte das gleiche problem. Mein Projekt war auf einem Netzlaufwerk gespeichert sind. Es gibt viele Sicherheits-und Bewertungsmethoden für meinen PC. Ich zog mein Projekt auf der lokalen Festplatte, und das problem war gelöst.
Wie es scheint "EntityFramework.Powershell.utility.dll" ist tring, um einige powershell-Funktionalität, und das system verhindert, dass die Ausführung eines solchen Anrufe, vielleicht, weil die dll ruft powershell ist keine lokale Datei.
In Ihrem Fall, stellen Sie sicher, dass Sie haben keine Sicherheit, Ordnung oder system-Konfiguration, dass würde verhindern, dass Ihr system führen Sie die problematische Erweiterung von einem nicht lokalen Laufwerk (EntityFramework.Powershell.utility.dll)
Konfrontiert ähnliches problem. Grund des Problems war die Verlagerung von meinem code von einer Maschine zur anderen... " Entfernen und anschließend neu installieren, entity framework hat das problem gelöst.
Update der Entity-Paket vom Paket-Manager-Konsole oder browser.