Stale MEF cache in Visual Studio: devenv /updateconfiguration or deleting ComponentModelCache?
0 reputation · 22 Nov 2024, 14:13 UTC
0 reputation · 22 Nov 2024, 14:13 UTC
After an extension is installed, updated, or uninstalled, Visual Studio's MEF component-model cache can serve stale composition results: IntelliSense returns outdated completions, extension commands disappear from menus, or editor features misbehave. Microsoft's documentation offers two rebuilds, and choosing between them is left to the user.
The lower-impact option is the documented devenv /updateconfiguration switch, which forces the IDE to merge installed packages and refresh the cache while preserving user settings and per-instance state. The heavier option is closing the IDE and deleting only the ComponentModelCache subfolder under %LocalAppData%\Microsoft\VisualStudio\<version-instance>, which regenerates on next launch and can clear corrupted or wedged state the switch may not reach.
Neither approach uninstalls extensions or touches project files, and both rebuild from installed components. However, no documented automatic invalidation covers every extension update or uninstall path, and no command reports whether the cache is stale. Switch support and folder naming can also vary by edition and update, so the installed instance needs confirmation before acting.
Is /updateconfiguration intended as the first-line fix for staleness, with folder deletion reserved for suspected corruption? Are there documented cases where the switch alone cannot recover a wedged cache? And is there any supported way to tell whether the cache is stale before rebuilding at all?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.