C# Visual Studio 2013 win 7中安装EntityFramework时出错

C# Visual Studio 2013 win 7中安装EntityFramework时出错,c#,entity-framework,visual-studio-2013,windows-7,C#,Entity Framework,Visual Studio 2013,Windows 7,我正在Visual Studio 2013 win 7中从事RESTful Web服务设计 我需要运行“enablemgrations”命令来实现项目中的代码优先迁移 这可以将迁移文件夹添加到我的项目中。文件夹中会有一个Configuration.cs 我需要安装EntityFramework的新版本 当我安装它时,我得到了一个错误: PM> Install-Package EntityFramework -IncludePrerelease Installing 'EntityFra

我正在Visual Studio 2013 win 7中从事RESTful Web服务设计

我需要运行“enablemgrations”命令来实现项目中的代码优先迁移

这可以将迁移文件夹添加到我的项目中。文件夹中会有一个Configuration.cs

我需要安装EntityFramework的新版本

当我安装它时,我得到了一个错误:

 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
PM>安装程序包EntityFramework-包括发布版本
安装“EntityFramework 6.1.3-beta1”。
您正在从Microsoft下载EntityFramework,其许可协议位于http://go.microsoft.com/fwlink/?LinkID=xxxxxxx. 
已成功安装“EntityFramework 6.1.3-beta1”。
是否要运行来自此不受信任发布者的软件?
文件\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\init.ps1由CN=Microsoft Corporation、OU=MOPR、O=Microsoft Corporation、L=Redmond、S=Washington、C=US发布,在您的系统上不受信任。仅运行来自受信任发布者的脚本。
[五] 从不运行[D]不运行[R]运行一次[A]始终运行[?]帮助(默认为“D”):R
是否要运行来自此不受信任发布者的软件?
文件\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.psm1由CN=Microsoft Corporation、OU=MOPR、O=Microsoft Corporation、L=Redmond、S=Washington、C=US发布,在您的系统上不受信任。仅运行来自受信任发布者的脚本。
[五] 从不运行[D]不运行[R]运行一次[A]始终运行[?]帮助(默认为“D”):R
在ProductReviews中添加“EntityFramework 6.1.3-beta1”。
已成功将“EntityFramework 6.1.3-beta1”添加到ProductReviews。
是否要运行来自此不受信任发布者的软件?
文件\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\install.ps1由CN=Microsoft Corporation、OU=MOPR、O=Microsoft Corporation、L=Redmond、S=Washington、C=US发布,在您的系统上不受信任。仅运行来自受信任发布者的脚本。
[五] 从不运行[D]不运行[R]运行一次[A]始终运行[?]帮助(默认为“D”):R
使用“1”参数调用“LoadFrom”时出现异常:“无法加载文件或程序集文件://\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.PowerShell.Utility.dll”或其依赖项之一。不支持操作。(HRESULT异常:0x8013155)
位于\\Mypath\packages\EntityFramework.6.1.3-beta1\tools\EntityFramework.psm1:780 char:62

+$utilityAssembly=[System.Reflection.Assembly]::LoadFrom尝试在没有预发行版的情况下安装实体框架:


安装程序包EntityFramework

您的错误意味着与您使用的网络共享(\Mypath)相关


Microsoft在最后一天应用了安全更新以加强UNC路径。也许这就是我们的问题所在。我从未使用网络共享创建项目。我总是使用本地路径并将更改提交到版本控制软件中。第二个问题是一个新问题。在新问题中提供有关您的型号和错误的更多详细信息。

\\MyPath\看起来像网络共享。请尝试使用本地文件夹和硬盘。@magicandre1981,为什么\Mypath不能成为网络共享?我在那里安装了软件包并创建了项目。我在没有预发布的情况下安装了entity framework,得到了相同的错误。@magicandre1981当时可能是对的,这是路径问题。您可以尝试以对该驱动器具有权限的用户身份运行visual studio。因此,如果您的管理员帐户具有权限,您可以尝试以管理员身份运行visual studio。