0

I am trying to debug my ASP.NET app in a pseudo production environment, i.e. with launchSettings.json profile setting:

"environmentVariables": {
   "ASPNETCORE_ENVIRONMENT": "Production"
}

I'd like to debug the app behaviour after my database service throws an error. The app should display Pages/Error.cshtml page. I can set a breakpoint inside OnGet method in Pages/Error.cshtml.cs and debug it.

However, after about 20 seconds, Visual Studio displays its own error window on top of everything, with information that it failed to launch debug adapter. After clicking OK, the debug session is automatically stopped.

Is it possible to temporarily set the timeout after which this window pops up to e.g. 10 minutes?

Below is a screenshot of VS error window.

enter image description here

camcam
  • 2,585
  • 8
  • 49
  • 65

1 Answers1

0

Ok, I think I found the way to keep the error window from opening. The problem was that the launchSettings.json had additionally a special inspectUri (which I forgot to mention):

"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"

I added this line when hosted a Blazor app on one of the pages. It works well in "Development", but apparently not with "Production" setting and it's not needed there either. So I deleted it and the problem was gone.

camcam
  • 2,585
  • 8
  • 49
  • 65