diff --git a/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs b/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs index a2ede57649..2b294ac8a6 100644 --- a/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs +++ b/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs @@ -117,7 +117,13 @@ namespace Microsoft.AspNetCore.Builder void OnOutputDataReceived(object sender, DataReceivedEventArgs eventArgs) { - if (!String.IsNullOrEmpty(eventArgs.Data) && ApplicationStartedRegex.IsMatch(eventArgs.Data)) + if (String.IsNullOrEmpty(eventArgs.Data)) + { + taskCompletionSource.TrySetException(new InvalidOperationException( + "No output has been recevied from the application.")); + } + + if (ApplicationStartedRegex.IsMatch(eventArgs.Data)) { aspNetProcess.OutputDataReceived -= OnOutputDataReceived; if (!string.IsNullOrEmpty(capturedUrl))