[release/9.0-staging] Backport "Dispose Xunit ToolCommand" by ilonatommy · Pull Request #116685 · dotnet/runtime

src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs Refactored DotNetCommand usage to a using block for proper disposal. src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs Updated RunCommand usage with a using declaration. src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs Converted DotNetCommand to using block for resource management. src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs Refactored multiple RunCommand and DotNetCommand usages to using blocks. src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs Updated command execution to use using blocks. src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs Refactored DotNetCommand usage to use a using block with ToolCommand. src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs Added an isDisposed flag and updated event handlers to check disposal state. src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs Converted DotNetCommand usage to a using block via ToolCommand. src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs, MiscTests2.cs, CleanTests.cs, BlazorWasmTestBase.cs Consistently applied using patterns to improve resource cleanup in test scenarios.