Skip to content

Commit ba2d69d

Browse files
committed
Fix #195: run the command line application on the same thread used to start generic host
1 parent a98f9fd commit ba2d69d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Hosting.CommandLine/Internal/CommandLineService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public CommandLineService(ILogger<CommandLineService<T>> logger, CommandLineStat
4747
public Task<int> RunAsync(CancellationToken cancellationToken)
4848
{
4949
_logger.LogDebug("Running");
50-
return Task.Run(() => _state.ExitCode = _application.Execute(_state.Arguments), cancellationToken);
50+
// TODO support cancellation tokens. See #111
51+
_state.ExitCode = _application.Execute(_state.Arguments);
52+
return Task.FromResult(_state.ExitCode);
5153
}
5254

5355
public void Dispose()

0 commit comments

Comments
 (0)