Visual studio 2010 如何在Package Manager控制台中启用迁移?
我试图在MVC4 Entity Framework 5.00中启用迁移,但是当我输入命令时,它会抛出以下错误:Visual studio 2010 如何在Package Manager控制台中启用迁移?,visual-studio-2010,asp.net-mvc-4,entity-framework-5,Visual Studio 2010,Asp.net Mvc 4,Entity Framework 5,我试图在MVC4 Entity Framework 5.00中启用迁移,但是当我输入命令时,它会抛出以下错误: Cannot determine a valid start-up project. Using project 'EFMigrations' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter t
Cannot determine a valid start-up project. Using project 'EFMigrations' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file://\\s01\data\Documents\Visual Studio 2010\Projects\EFMigrations\packages\EntityFramework.5.0.0\tool
s\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At \\s01\data\Documents\Visual Studio 2010\Projects\EFMigrations\packages\EntityFramework.6.0.0-beta1\tools\EntityFramework.psm1:669 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 \\s01\data\Documents\Visual Studio 2010\Projects\EFMigrations\packages\EntityFramework.6.0.0-beta1\tools\EntityFramework.psm1:670 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://\\s01\data\Documents\Visual Studio 2010\Projects\EFMigrations\packages\EntityFramework.
5.0.0\tools\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At \\s01\data\Documents\Visual Studio 2010\Projects\EFMigrations\packages\EntityFramework.6.0.0-beta1\tools\EntityFramework.psm1:698 char:31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
任何和所有的帮助都将不胜感激 不支持从网络路径运行迁移 EF团队分类:迁移命令需要完全信任才能运行。因为您是从网络共享运行的,所以看起来您运行的信任级别较低。在过去,我们决定迁移命令需要完全信任,因为它降低了实现的复杂性
这意味着您必须将项目放在本地驱动器上,然后才能运行迁移。不支持从网络路径运行迁移 EF团队分类:迁移命令需要完全信任才能运行。因为您是从网络共享运行的,所以看起来您运行的信任级别较低。在过去,我们决定迁移命令需要完全信任,因为它降低了实现的复杂性
这意味着您必须将项目放在本地驱动器上,然后才能运行迁移。事实证明@Stijn的答案确实正确,但它并没有提供问题的解决方案,解决方案是简单地将整个项目复制并粘贴到硬盘中,命令将起作用。事实证明@Stijn的答案确实正确,但它并没有提供问题的解决方案,解决方案是简单地将整个项目复制并粘贴到硬盘中,命令就会起作用我认为这是显而易见的下一步。我会把它添加到我的答案中。你可以这样做,但为什么你在将近一年后不接受我的答案呢?我认为这是显而易见的下一步。我会把它添加到我的答案中。你可以这样做,但为什么你在将近一年后不接受我的答案?很好地解决了我的问题,但现在我知道它是什么,但我必须说,在今天这个时代,我发现做出这样的决定完全是疯狂的,这一决定可能会削弱左右和中间的主要项目,cmon MS您可以做得更好。是的,事实证明,将项目放在网络共享上是问题的根源。它正在完成请求,但仍然抛出错误消息。感谢解决了我的问题,我的问题没有得到很好的解决,但现在我知道它是什么,但我必须说,在今天这个时代,我发现做出这样的决定是完全疯狂的,这一决定可能会削弱左右和中间的重大项目,cmon MS您可以做得更好。是的,事实证明,将项目放在网络共享上是问题的根源。它正在完成请求,但仍然抛出错误消息。谢谢你的解决方案