From 6f780bb9ea1cc2439c6c16dfd17b22a220e8cd70 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Fri, 28 Aug 2020 08:04:22 -0700 Subject: [PATCH] Throw exception if DebugProxy received no output --- .../WebAssembly/Server/src/DebugProxyLauncher.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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))