Skip to content

Commit 68de853

Browse files
authored
Remove .NET 6 assemblies in BC 27 and higher (#3926)
Remove .NET 6 assemblies in BC 27 and higher
1 parent c846102 commit 68de853

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ContainerHandling/New-NavContainer.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,14 @@ if (-not `$restartingInstance) {
22122212
}
22132213
}
22142214

2215+
if ($Version.Major -ge 27) {
2216+
Invoke-ScriptInBcContainer -containerName $containerName -scriptblock {
2217+
Write-Host "Cleanup old dotnet core assemblies"
2218+
Remove-Item -Path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.*' -Recurse -Force -ErrorAction SilentlyContinue
2219+
Remove-Item -Path 'C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\6.0.*' -Recurse -Force -ErrorAction SilentlyContinue
2220+
}
2221+
}
2222+
22152223
if ($includeAL) {
22162224
$dotnetAssembliesFolder = Join-Path $containerFolder ".netPackages"
22172225
New-Item -Path $dotnetAssembliesFolder -ItemType Directory -ErrorAction Ignore | Out-Null

0 commit comments

Comments
 (0)