【问题标题】:Visual Studio Component Cache Out of DateVisual Studio 组件缓存过期
【发布时间】:2016-06-22 01:53:39
【问题描述】:

几乎每次我尝试为 EF 迁移运行 update-database 命令时,我都会在 Visual Studio 2015 中收到以下错误:

使用“1”个参数调用“GetService”的异常:“异常 使用“2”个参数调用“Invoke”:“Visual Studio 组件 缓存已过期。请重新启动 Visual Studio。视觉工作室 组件缓存已过期。请重新启动 Visual Studio。"" 在 D:\Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1004 字符:5 + $packageInstallerServices = $componentModel.GetService([NuGet.Vis ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ScriptMethodRuntimeException 您不能在空值表达式上调用方法。在 D:\Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:1006 字符:5 + $vsPackage = $packageInstallerServices.GetInstalledPackages() | ? ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull Join-Path:无法将参数绑定到参数“路径”,因为它为空。在 D:\Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:713 字符:28 + $toolsPath = 加入路径 $installPath 工具 +~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand 加入路径:无法将参数绑定到参数“路径”,因为它是 空值。在 D:\Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 字符: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 字符:5 + $dispatcher = $utilityAssembly.CreateInstance( + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull Join-Path:无法将参数绑定到参数“路径”,因为它为空。在 D:\Dev\Project\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:810 字符:20 +(加入路径 $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。

【问题讨论】:

标签: visual-studio-2015 entity-framework-6 entity-framework-migrations


【解决方案1】:

尝试在我的 SQL Server 管理工作室中选择记录时出现此错误:

错误:“Visual Studio 组件缓存已过期。请重新启动 Visual Studio。(Microsoft.VisualStudio.ExtensibilityHosting)”

我重新启动了 Visual Studio,但出现了同样的错误。

解决方案:我去了这个位置:“C:\Users\username\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache”

并删除了该文件夹中的所有文件并重新启动了 VS 和 SQL 服务器。成功了!

【讨论】:

  • 我遇到了同样的问题,但是我没有删除文件,而是关闭了 Visual Studio 并重新启动了 SQL Server Management Studio。这对我有用
【解决方案2】:

你应该去

%APPDATA%\Local\Microsoft\Visual Studio\<version>

并删除 ComponentModelChache 目录。

【讨论】:

  • 这是非常正确的。谢谢!
猜你喜欢
  • 2016-06-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-09
  • 2010-10-28
  • 2013-02-04
相关资源
最近更新 更多