Web socket Exception crashing Blazor WASM while debugging in VS2022? - asp.net

I'm having some trouble trying to get Blazor WASM debugging to work with VS2022 17.3.3 and was wondering if anyone on here could give me a hand/ had encountered this issue before?
When running any Blazor WASM project(I've tried with a fresh project as well) with the debugger, it will open correctly and run for about ~10-60s, before crashing and closing the browser. I get the following error in the debug console:
Console output of debug run
When running without debugger or via CLI the application runs without crashing.
I originally had an error in the browser identical to the one described here: https://learn.microsoft.com/en-us/answers/questions/741393/error-with-websocket.html but after disabling Hot Reload and Browser link this no longer started appearing, the crashing error still occurred though. Interestingly after re-enabling these settings the browser error has not reoccurred, and from what I can see hot reload isn't working at all when running with the debugger attatched.
Thanks for the help and happy to post any further details on my setup if anything else could be useful.

Related

NPM invoked on Angular page startup and crashes

We have a couple of ASP.Net + Angular (.Net Core 2.1, Angular5) web pages on the IIS server that suddenly stopped working.
We get "AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ))".
It seems that it attempts to run npm as the web is launched and it crashes. I tried to install Nodejs on the server and I can see the npm really starts, but crashes with mkdir operation not permitted. Anyway, I don't understand why it's started in the first place.
When start the same app on local IIS npm is not started and app runs without the problem.
We can't find what happened on the server. The same apps ran smoothly before.
Many thanks.
Michal
Solved. Colleagues set ASPNETCORE_ENVIRONMENT = DEVELOPMENT. Changing it back to Production fixed it.

Unexpected error - Angular 1 + Meteor 1.6

I am getting this error on the client side in browser web application.
Unexpected error.
This appears in a totally white blank page in the browser on the top left corner when I access my web application.
It appears occasionally. There is no error in the Meteor Server Console or in the browser console. It can't be reproduced either.
Whenever this error appears, none of my client apps (Android, iOS, web app) work, when they are connected to this specific server. The server shows that it's running but it does not. When I restart Meteor Server, then it starts working fine, I get this error once in about two weeks, I don’t know what is causing this error, or how to debug this.
Any idea what is causing this issue? This is really critical, I have my Live Application running, and it should not crash like this. Please provide me with some solution or a way to debug. Thanks
Also are there any logs on my Meteor App which I can check? Plus I am running this App on staging with --production flag.

Unable to start debugging on the web server. The remote server returned an error: (404) Not Found. Error when starting debug in Visual Studio

I have set up project to be run on IIS for some time ago and when I did press F5 it did connect no problem. But recently this stopped working and I did get this error when I press F5 / press Debug->Start debugging:
Unable to start debugging on the web server. The remote server
returned an error: (404) Not Found.
Here is my settings:
I am not sure what happened, probably some VS updates or Windows updates, but I've tried to google everywhere and nothing had worked. Attach to process works fine as before, but this simpler way stopped doing the trick.
Update:
Have tried Process Monitor to figure out what is going wrong and it looks like w3wp tries to access path MyProjectFolder\debugattach.aspx and the result is "NAME NOT FOUND". Don't know if this is the root of the problem though.
It appears that one of my colleagues has edited the web.config and added request filtering where he has removed the "DEBUG" verb. This disallowed debugging on F5.
After adding it (or removing request filtering) everything works fine.
P.S. A lot of other possible problems with similar error is described here
In my case (Windows 10 & Visual Studio 2017) I had to install ASP.NET 3.5 and ASP.NET 4.7 under the Internet Information Services.
Click here to see the solution
Old post but I recently had this issue and making sure that the following settings were enabled in 'Programs and Features' (Windows 10) fixed the issue for me:
This happened to me because I was using the Rewrite module to redirect to https. I was running https://localhost/WebSiteName, but had put my machine name in the https binding in IIS Mgr, Default web Site, Bindings. When I removed the machine name it worked.
Recently I have faced the same issue in VS2013 Professional, instantly I get error 'Unable to start debugging on web server". I observed that whenever my current page is MVC view (.cshtml) file and I start debugging , the error window prompts every time. As switch the current document in my project to controller (.cs) file, and starts debugging, it works properly.
So my workaround is to debug my code I have to be on (.cs) file not on (.cshtml / web.config) file. Hope that helps!
Another reason for this problem is that you don't run visul studio Run as administrator.
My issue was related 405 as attached below
My issue got resolved after making my projects properties(Web and Build) as given below
see this also
HTTP Error 404.3-Not Found in IIS 10 as it helped me (HTTP Activation need to be enabled in Windows features)

IISExpress not connecting when trying to debug

I'm working a ASP.NET MVC project in Visual Studio 2015 (14.0.25431.01 Update 3) that runs IISExpress to debug the application. However, sometimes (and I haven't figure out what the trigger is) when I debug the application my browser will open to the correct URL but it will just say "Unable to connect".
If I try to refresh the window nothing changes. If I check Visual Studio it still says it's debugging so the debugger or IIS doesn't seem to have crashed. Sometimes if I just click Restart it will work fine. However, sometimes this error continues and I have to kill the IIS process. I've tried deleting the files under .vs\config but that didn't help.
Is there any way to fix this or anyway to find some logs to see whats happening? This started in the last few weeks and it starting to drive me crazy.
Edit
Happened again and tried connecting via Chrome as well as my usual FireFox. Looking at the developer tools in Chrome I'm seeing the ERR_CONNECTION_REFUSED message.
I decided to check the Windows Event Viewer and found that it looks like IIS Express can't bind to the port.The error message is:
Unable to bind to the underlying transport for [::]:12345. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
But why it can't bind to that port I don't understand.

Visual Studio 2008 crashes on third time

I have this strange problem which I can't seem to fix.
I have made an ASP.Net application in Visual Studio 2008. When ever I try to debug the third time, VS gives that error i.e. send report to Microsoft. Now I had to close VS and start again to debug. Then again I am able to debug two times and then again error after which I have to close VS and start again.
Here's some clarification if you still don't understand.
Run F5 to debug application. Web server starts. Browser opens and my site opens in it.
Stop debugger
Run F5 to debug again and everything goes fine as usual
Stop debugger
Now if I press F5 the third time, it gives error.
Any idea how to fix this issue?
Try closing all instances of the browser before debugging again. I've done this to resolve this type of error before (using Firefox). It seemed to be a browser issue.
Now I started visual studio from command prompt as below and it doesn't crash.
devenv.exe /log

Resources