Skip to content

Commit 208ee34

Browse files
committed
Build.ps1: stop vsmon.exe when script exits.
1 parent 363daaf commit 208ee34

File tree

2 files changed

+9
-33
lines changed

2 files changed

+9
-33
lines changed

scripts/UnlistAll.ps1

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/PostSharp.Engineering.BuildTools/Resources/Build.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ if ( $VsDebug )
1919
{
2020
$vsmonport = 4024
2121
Write-Host "Starting Visual Studio Remote Debugger, listening at port $vsmonport." -ForegroundColor Cyan
22-
Start-Process -FilePath "C:\msvsmon\msvsmon.exe" `
22+
$vsmonProcess = Start-Process -FilePath "C:\msvsmon\msvsmon.exe" `
2323
-ArgumentList "/noauth","/anyuser","/silent","/port:$vsmonport","/timeout:2147483647" `
24-
-NoNewWindow
24+
-NoNewWindow -PassThru
2525
}
2626

2727
# Change the prompt and window title in Docker.
@@ -37,4 +37,11 @@ if ( $env:RUNNING_IN_DOCKER )
3737
if ( -not $Interactive -or $BuildArgs )
3838
{
3939
& dotnet run --project "$PSScriptRoot\$EngPath\src\Build$ProductName.csproj" -- $BuildArgs
40+
41+
if ( $VsDebug )
42+
{
43+
Write-Host ""
44+
Write-Host "Killing vsmon.exe."
45+
$vsmonProcess.Kill()
46+
}
4047
}

0 commit comments

Comments
 (0)