Skip to content

Commit a28c958

Browse files
committed
OX-02 P14: rebuild the hive's MEF cache after installing the VSIX
The run on 4289f6a printed a correct manifest (MefComponent Owen.VisualStudio.dll) and an installed, enabled extension, yet the hive's ComponentModelCache files were byte-for-byte those of the previous run: the image ships the MEF composition prebuilt and the install rebuilt only the pkgdef cache, so Owen's parts were never composed. Drop the cache and run devenv /updateconfiguration before launching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
1 parent 4289f6a commit a28c958

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎scripts/vs/owen-vs-acceptance.ps1‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ $p = Start-Process $installer -ArgumentList "/quiet", "/rootSuffix:$RootSuffix",
107107
Check "install-vsix" ($p.ExitCode -eq 0) "VSIXInstaller exit $($p.ExitCode) into root suffix $RootSuffix"
108108
if ($p.ExitCode -ne 0) { $results | ConvertTo-Json -Depth 8 | Set-Content (Join-Path $Out 'results.json'); exit 1 }
109109

110+
# The MEF composition is cached per hive (ComponentModelCache). A hosted image ships that
111+
# cache prebuilt, and installing an extension rebuilt the pkgdef cache but not this one (the
112+
# run on 4289f6a: the cache files were byte-for-byte the image's, no part of Owen in them).
113+
# Drop it so Visual Studio composes again with the installed extension, as /updateconfiguration
114+
# would on a developer machine.
115+
foreach ($h in (Get-ChildItem (Join-Path $env:LOCALAPPDATA 'Microsoft\VisualStudio') -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -like "*$RootSuffix" })) {
116+
$cache = Join-Path $h.FullName 'ComponentModelCache'
117+
if (Test-Path $cache) { Remove-Item -Recurse -Force $cache; Log "dropped the MEF cache $cache" }
118+
}
119+
$u = Start-Process $devenv -ArgumentList "/rootsuffix", $RootSuffix, "/updateconfiguration" -Wait -PassThru
120+
Log "devenv /updateconfiguration exit $($u.ExitCode)"
121+
110122
$major = $vs.installationVersion.Split('.')[0]
111123
$activity = Join-Path $Out 'ActivityLog.xml'
112124
$t0 = Now

0 commit comments

Comments
 (0)