I am working on RESTful Web services design in Visual Studio 2013 win 7.
I need to run the command of "Enable-Migrations" to ennables Code First Migrations in a project.
This can add a Migrations folder to my project. And there will be a Configuration.cs in the folder.
I need to install a new version of EntityFramework.
When I installed it , I got error:
PM> Install-Package EntityFramework -IncludePrerelease
Installing 'EntityFramework 6.1.3-beta1'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkID=xxxxxxx.
Successfully installed 'EntityFramework 6.1.3-beta1'.
Do you want to run software from this untrusted publisher?
File \\Mypath\packages\EntityFramework.6.1.3-beta1\tools\init.ps1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):R
Do you want to run software from this untrusted publisher?
File \\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.psm1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):R
Adding 'EntityFramework 6.1.3-beta1' to ProductReviews.
Successfully added 'EntityFramework 6.1.3-beta1' to ProductReviews.
Do you want to run software from this untrusted publisher?
File \\Mypath\packages\EntityFramework.6.1.3-beta1\tools\install.ps1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):R
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file://\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At \\Mypath\packages\EntityFramework.6.1.3-beta1\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 \\Mypath\packages\EntityFramework.6.1.3-beta1\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:// \\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At \\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.psm1:809 char:31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file://\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At \\ Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.psm1:780 char:62
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I do not understamd the error. How to solve it ? Thanks !
UPDATE
I can build the project by using local drive now.
But, I got a new error, please see the attached pic.
Your error means to be related to your used network share (\Mypath).
Microsoft applied a security update to harden UNC path with last patchday. Maybe this causes our issue. I never used network share to create projects. I always use local paths and commit changes into a version control software. The second issue is a new question. Provide more details about your model and the error in a new question.
try installing entity framework without the prereleases:
Install-Package EntityFramework
User contributions licensed under CC BY-SA 3.0