运行启用迁移时遇到错误

时间:2016-01-19 17:52:11

标签: powershell visual-studio-2015 entity-framework-6 powershell-v5.0

我在ASP.NET MVC5项目(Powershell v5& Visual Studio 2015)上运行Enable-Migrations时出现以下错误。我试图卸载并重新安装EntityFramework(v6.1.3),但没有幸运。 有谁知道如何解决它?

  

输入名称' Microsoft.VisualStudio.Shell.Package'是不明确的,它可能是' Microsoft.VisualStudio.Shell.Package,Microsoft.VisualStudio.Shell.14.0,Version = 14.0.0.0,Culture = neutral,   公钥= b03f5f7f11d50a3a'或者' Microsoft.VisualStudio.Shell.Package,Microsoft.VisualStudio.Shell.11.0,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'。   在C:\ PROGRAM FILES(X86)\ MICROSOFT VISUAL STUDIO 14.0 \ COMMON7 \ IDE \ EXTENSIONS \ MSHGPU2S.W4I \ Modules \ NuGet \ profile.ps1:126 char:5   + $ service = [Microsoft.VisualStudio.Shell.Package] :: GetGlobalServi ...   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~       + CategoryInfo:InvalidArgument:(:) [],RuntimeException       + FullyQualifiedErrorId:AmbiguousTypeReference

     

输入名称' NuGet.VisualStudio.IVsPackageInstallerServices'是不明确的,它可能是' NuGet.VisualStudio.IVsPackageInstallerServices,Microsoft.VisualStudio.ApplicationInsights,Version = 4.0.0.0,Culture = neutral,   公钥= b03f5f7f11d50a3a'或者' NuGet.VisualStudio.IVsPackageInstallerServices,Microsoft.VisualStudio.Web.Application,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:1004 char:5   + $ packageInstallerServices = $ componentModel.GetService([NuGet.Vis ...   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~       + CategoryInfo:InvalidArgument:(:) [],RuntimeException       + FullyQualifiedErrorId:AmbiguousTypeReference

     

您无法在空值表达式上调用方法。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:1006 char:5   + $ vsPackage = $ packageInstallerServices.GetInstalledPackages()| ? ...   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~       + CategoryInfo:InvalidOperation:(:) [],RuntimeException       + FullyQualifiedErrorId:InvokeMethodOnNull

     

Join-Path:无法将参数绑定到参数' Path'因为它是null。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:713 char:28   + $ toolsPath = Join-Path $ installPath工具   + ~~~~~~~~~~~~       + CategoryInfo:InvalidData:(:) [Join-Path],ParameterBindingValidationException       + FullyQualifiedErrorId:ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

     

Join-Path:无法将参数绑定到参数' Path'因为它是null。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:780 char:74   + ... [System.Reflection.Assembly] :: LoadFrom((Join-Path $ ToolsPath EntityF ...   + ~~~~~~~~~~       + CategoryInfo:InvalidData:(:) [Join-Path],ParameterBindingValidationException       + FullyQualifiedErrorId:ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

     

您无法在空值表达式上调用方法。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:781 char:5   + $ dispatcher = $ utilityAssembly.CreateInstance(   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       + CategoryInfo:InvalidOperation:(:) [],RuntimeException       + FullyQualifiedErrorId:InvokeMethodOnNull

     

Join-Path:无法将参数绑定到参数' Path'因为它是null。   在D:\ xxx \ packages \ EntityFramework.6.1.3 \ tools \ EntityFramework.psm1:810 char:20   +(Join-Path $ runner.ToolsPath EntityFramework.PowerShell.dll),   + ~~~~~~~~~~~~~~~~~       + CategoryInfo:InvalidData:(:) [Join-Path],ParameterBindingValidationException       + FullyQualifiedErrorId:ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

1 个答案:

答案 0 :(得分:3)

如果你有11099到14257之间的任何Windows 10 Insider Preview版本,这是一个已知错误

官方错误报告https://entityframework.codeplex.com/workitem/2872