WithValidation(CommandResultValidation.None) ignored #210
Replies: 2 comments 1 reply
-
Hmm, it shouldn't get ignored. Are you sure that's the same |
Beta Was this translation helpful? Give feedback.
1 reply
-
Looks like it has to do with one of the steps in the tutorial that is off. If I pull the tutorial's repository from github it works. .cs are identical as mine which is odd. You can delete this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Using the example from Microsoft's create a windows service installer which uses CliWrap, I can't get the service to uninstall if the service is not running.
It seems to ignore WithValidation(CommandResultValidation.None) on windows 11 pro 21H2 OS Build 22000.1936
Works fine if the service is running but if the service is stopped, it will throw an exception.
the Event Viewer log entry:
Application: SolutionsIDSWindowsAgent.exe
CoreCLR Version: 7.0.523.17405
.NET Version: 7.0.5
Description: The process was terminated due to an unhandled exception.
Exception Info: CliWrap.Exceptions.CommandExecutionException: Command execution failed because the underlying process (sc.exe#32132) returned a non-zero exit code (1062).
Command:
sc stop ".NET Joke Service"
You can suppress this validation by calling
$(String[] args)WithValidation(CommandResultValidation.None)
on the command.at CliWrap.Command.ExecuteAsync(ProcessEx process, CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in D:\a\CliWrap\CliWrap\CliWrap\Command.Execution.cs:line 237
at CliWrap.Command.ExecuteAsync(ProcessEx process, CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in D:\a\CliWrap\CliWrap\CliWrap\Command.Execution.cs:line 251
at CliWrap.Command.ExecuteAsync(ProcessEx process, CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in D:\a\CliWrap\CliWrap\CliWrap\Command.Execution.cs:line 251
at Program.
at Program.(String[] args)
Beta Was this translation helpful? Give feedback.
All reactions