We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.7.0
.NET 8.0 / Windows 10
Expected Behaviour The child processes should be killed.
Actual Behaviour The child processes are not killed.
More information:
The behaviour in v3.7.0 is different to the previous version (v3.6.7).
I have example code. Running with 3.7.0 fails. Running with 3.6.7 passes.
Unit Test:
namespace test; using System.Diagnostics; using System.Text; using CliWrap; using NUnit.Framework; public class NotepadTest { [Test] public async Task LaunchAndKillNotepadViaCmd() { StringBuilder _outputBuilder = new(); Command cmd = Cli.Wrap("run.bat") .WithValidation(CommandResultValidation.ZeroExitCode) .WithStandardErrorPipe(PipeTarget.ToStringBuilder(_outputBuilder)) .WithStandardOutputPipe(PipeTarget.ToStringBuilder(_outputBuilder)); CancellationTokenSource cancellationTokenSource = new(); TaskCompletionSource task_completion = new(); CommandTask<CommandResult> cmd_task = null; await Task.Factory.StartNew(async() => { try { cmd_task = cmd.ExecuteAsync(cancellationTokenSource.Token); var result = await cmd_task; Console.Out.WriteLine("Task completed itself with exit code: " + result.ExitCode); } finally { Console.Out.WriteLine("Finally"); task_completion.SetResult(); } }); Console.WriteLine("Simulating work"); Thread.Sleep(1000); Console.WriteLine("Finished work"); var pid = cmd_task?.ProcessId; cancellationTokenSource.Cancel(); await task_completion.Task; Process p = Process.GetProcessById((int)pid); if (p != null && !p.HasExited) { Assert.Fail("Process has not been killed"); } else { Assert.Pass("Process has exited"); } } }
run.bat simply contains:
notepad.exe
The text was updated successfully, but these errors were encountered:
This looks to be caused by the recent .NET bump (#271), I'll fix it shortly.
Sorry, something went wrong.
Re-add net8.0 as a target framework
net8.0
72d3dba
Closes #270 Closes #271
Successfully merging a pull request may close this issue.
Version
v3.7.0
Platform
.NET 8.0 / Windows 10
Steps to reproduce
Details
Expected Behaviour
The child processes should be killed.
Actual Behaviour
The child processes are not killed.
More information:
The behaviour in v3.7.0 is different to the previous version (v3.6.7).
I have example code. Running with 3.7.0 fails. Running with 3.6.7 passes.
Unit Test:
run.bat simply contains:
Checklist
The text was updated successfully, but these errors were encountered: