Skip to content

Commit 643f608

Browse files
Fix ObjectDisposedException: swap mre/watcher declaration order in BuildsWhileBuildIsRunningOnServer
Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
1 parent 29dd0a5 commit 643f608

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MSBuild.UnitTests/MSBuildServer_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ public void BuildsWhileBuildIsRunningOnServer()
190190
_env.WithTransientProcess(pidOfServerProcess);
191191

192192
string? dir = Path.GetDirectoryName(markerFile.Path);
193-
using var watcher = new System.IO.FileSystemWatcher(dir!);
194193
using ManualResetEvent mre = new ManualResetEvent(false);
194+
using var watcher = new System.IO.FileSystemWatcher(dir!);
195195
watcher.Created += (o, e) =>
196196
{
197197
_output.WriteLine($"The marker file {markerFile.Path} was created. The build task has been started.");

0 commit comments

Comments
 (0)