jao*_*jao 4 ef-migrations entity-framework-6 visual-studio-2015
几乎每次我尝试运行用于EF迁移的update-database命令时,我在Visual Studio 2015中都会收到以下错误:
使用"1"参数调用"GetService"的异常:"异常调用"调用"with"2"参数:"Visual Studio组件缓存已过期.请重新启动Visual Studio.Visual Studio组件缓存已过期.请重新启动Visual Studio.""在D:\ Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 char:5 + $ packageInstallerServices = $ componentModel.GetService([NuGet.Vis ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ + CategoryInfo:NotSpecified:(:) [],MethodInvocationException + FullyQualifiedErrorId:ScriptMethodRuntimeException你不能在空值表达式上调用方法.在D:\ Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 char:5 + $ vsPackage = $ packageInstallerServices.GetInstalledPackages()|?... + ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation:(:) [],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull Join-Path:无法将参数绑定到参数'Path',因为它为null.在D:\ Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 char:28 + $ toolsPath = Join-Path $ installPath工具+ ~~~~~~~~~~~~ + CategoryInf o:InvalidData:(:) [Join-Path],ParameterBindingValidationException + FullyQualifiedErrorId:ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand Join-Path:无法将参数绑定到参数'Path',因为它为null.在D:\ Dev\Project\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:\ Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5 + $ dispatcher = $ utilityAssembly.CreateInstance(+ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation :( :) [],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull Join -Path:无法将参数绑定到参数'Path',因为它为null.在D:\ Dev\Project\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
大多数时候重新启动Visual Studio 2015将解决此问题,但有时我必须通过从C:\ Users {UserName}\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache中删除所有项目来手动清除组件缓存
我以管理员身份运行VS2015.
Lui*_*ldi 11
你应该去
%APPDATA%\Local\Microsoft\Visual Studio\<version>
Run Code Online (Sandbox Code Playgroud)
并删除ComponentModelChache目录.
小智 5
当我尝试在 SQL Server Management Studio 中选择记录时,出现此错误:
错误: “Visual Studio 组件缓存已过期。请重新启动 Visual Studio。(Microsoft.VisualStudio.ExtensibilityHosting)”
我重新启动 Visual Studio 但出现同样的错误。
解决方案:我去了这个位置:“C:\Users\用户名\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache”
并删除该文件夹中的所有文件并重新启动 VS 和 SQL Server。有效!
| 归档时间: |
|
| 查看次数: |
5098 次 |
| 最近记录: |