Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
881 views
in Technique[技术] by (71.8m points)

powershell - Get error while running Enable-Migrations

I got below error while running Enable-Migrations on my ASP.NET MVC5 project (Powershell v5 & Visual Studio 2015). I have tried to uninstall and re-install EntityFramework (v6.1.3) but no lucky. Does anyone know how to solve it?

Type name 'Microsoft.VisualStudio.Shell.Package' is ambiguous, it could be 'Microsoft.VisualStudio.Shell.Package, Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or 'Microsoft.VisualStudio.Shell.Package, Microsoft.VisualStudio.Shell.11.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. At C:PROGRAM FILES (X86)MICROSOFT VISUAL STUDIO 14.0COMMON7IDEEXTENSIONSMSHGPU2S.W4IModulesNuGetprofile.ps1:126 char:5 + $service = [Microsoft.VisualStudio.Shell.Package]::GetGlobalServi ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [], RuntimeException + FullyQualifiedErrorId : AmbiguousTypeReference

Type name 'NuGet.VisualStudio.IVsPackageInstallerServices' is ambiguous, it could be 'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.ApplicationInsights, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or 'NuGet.VisualStudio.IVsPackageInstallerServices, Microsoft.VisualStudio.Web.Application, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:1004 char:5 + $packageInstallerServices = $componentModel.GetService([NuGet.Vis ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [], RuntimeException + FullyQualifiedErrorId : AmbiguousTypeReference

You cannot call a method on a null-valued expression. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:1006 char:5 + $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:713 char:28 + $toolsPath = Join-Path $installPath tools + ~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:780 char:74 + ... [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityF ... + ~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

You cannot call a method on a null-valued expression. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:781 char:5 + $dispatcher = $utilityAssembly.CreateInstance( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null. At D:xxxpackagesEntityFramework.6.1.3oolsEntityFramework.psm1:810 char:20 + (Join-Path $runner.ToolsPath EntityFramework.PowerShell.dll), + ~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is a known bug if you have any of the Windows 10 Insider Preview builds from 11099 to 14257

Official bug report https://entityframework.codeplex.com/workitem/2872


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...