Aspnetcore: Blazor WASM .NET5 RC-1 Debugging fails with error: "Value cannot be null. (Parameter 'input')"

Created on 27 Sep 2020  ·  5Comments  ·  Source: dotnet/aspnetcore

Describe the bug

  • Using Visual Studio Version 16.8.0 Preview 3.1
  • The solution is a Web Assembly App, ASP.NET Core hosted, PWA, using Individual accounts.
  • When running normally the app successfully executes allowing logins, logouts and displaying a basic page. When Debugging a blank browser page is displayed and Visual Studio generates the following exception:

System.ArgumentNullException
HResult=0x80004003
Message=Value cannot be null. (Parameter 'input')
Source=System.Text.RegularExpressions
StackTrace:
at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)
at System.Text.RegularExpressions.Regex.IsMatch(String input)
at Microsoft.AspNetCore.Builder.DebugProxyLauncher.<>c__DisplayClass10_0.g__OnOutputDataReceived|0(Object sender, DataReceivedEventArgs eventArgs)
at System.Diagnostics.Process.OutputReadNotifyUser(String data)
at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Diagnostics.AsyncStreamReader.<>c.b__18_0(Object edi)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafeTState
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

This exception was originally thrown at this call stack:
System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(System.Text.RegularExpressions.ExceptionArgument)
System.Text.RegularExpressions.Regex.IsMatch(string)
Microsoft.AspNetCore.Builder.DebugProxyLauncher.CompleteTaskWhenServerIsReady.__OnOutputDataReceived|0(object, System.Diagnostics.DataReceivedEventArgs)
System.Diagnostics.Process.OutputReadNotifyUser(string)
System.Diagnostics.AsyncStreamReader.FlushMessageQueue(bool)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Diagnostics.AsyncStreamReader.FlushMessageQueue.AnonymousMethod__18_0(object)
System.Threading.QueueUserWorkItemCallback..cctor.AnonymousMethod__6_0(System.Threading.QueueUserWorkItemCallback)
System.Threading.ExecutionContext.RunForThreadPoolUnsafe(System.Threading.ExecutionContext, System.Action, TState)
System.Threading.QueueUserWorkItemCallback.Execute()
...
[Call Stack Truncated]

To Reproduce

Exceptions (if any)

Further technical details

  • ASP.NET Core version
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version
Answered Resolved area-blazor feature-blazor-debugging

Most helpful comment

@captainsafia Thanks! I retried the work around in this comment (I missed an edit the first time) and debugging is working for me now! Thanks for your help.
https://github.com/dotnet/aspnetcore/issues/25887#issuecomment-693487470

All 5 comments

Thanks for filing this bug report, @JimKgit!

It looks like you're running into a known issue with RC1. It'll be resolved in RC2. In the meantime, #25887 and referenced issues can help you find workarounds for this in RC1.

Thanks for the follow up.

I just checked the other issues you referenced and I believe those are not the same. My issue with debugging is that it is choking on System.Text.RegularExpressions as the Source in the stack trace whereas the others that you referenced are having issues with ports. Is my issue truly one that has been addressed in RC2 as mentioned above and if so are there any workarounds for my specific error? Please confirm.

@JimKgit Yep, it's the same issue. You can confirm by examining what is printed in the Output panel of Visual Studio.

It'll likely be the issue about the existing port. It manifests as a RegularExpressions issue because that's the codepath that attempts to parse the standard output, which isn't generated when the debugging proxy fails to launch due to an already used port.

@captainsafia Thanks! I retried the work around in this comment (I missed an edit the first time) and debugging is working for me now! Thanks for your help.
https://github.com/dotnet/aspnetcore/issues/25887#issuecomment-693487470

Was this page helpful?
0 / 5 - 0 ratings