Open Kevin-Andrew opened 4 months ago
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | Kevin-Andrew |
---|---|
Assignees: | - |
Labels: | `arch-wasm`, `untriaged`, `needs-area-label` |
Milestone: | - |
This is not a wasm debugging issue. This is debugging the "server" side of the blazor app, which is coreclr debugging. I know this because "Suppress JIT optimization on module load (Managed only)" is completely unused on wasm debugging, so it wouldn't affect anything. And also looking at the callstack it's possible to see that is debugging a coreclr app and not a wasm app because of the format of the call stack and the "External Code" thing, this is not available for wasm debugging.
I'm also sick of this problem. The error appears periodically on different computers using Visual studio 2022 in Blazor projects. Sometimes selectively deleting temporary folders helped, but not always
Is there an existing issue for this?
Describe the bug
Same error as was reported in https://github.com/dotnet/aspnetcore/issues/48587.
(Why do you close these such that no one can leave any more comments? And force people to open new ones, and then just end up with a bunch to scattered information?)
My Blazor Web Assembly application had been working for over a year. I now seldom have to make any updates to it, so it's not like I'm working on it every day. Therefore, there have been many changes to my system and even an update to Visual Studio, I'm sure, since the last time I worked in the project and attempted to run the debugger.
So I opened it today, set a breakpoint, then clicked to start debugging. A new web browser, MS Edge, opened with a new blank tab, but then in Visual Studio, I received the following:![image](https://github.com/dotnet/aspnetcore/assets/22459191/6413634a-b22e-417d-af6b-87ffa24ffe5a)
I looked at the stack trace, but none of my code was in there. A minute later, I received this additional error dialog: Failed to launch debug adapter. Unable to launch browser: "Could not open wss://localhost:7299/_framework/debug/ws-proxy?browser=..."![image](https://github.com/dotnet/aspnetcore/assets/22459191/32f2c33c-70b6-4c85-a8cb-fbf9819527b4)
After a bunch of searching and trying things, and finding the previously reported issue, https://github.com/dotnet/aspnetcore/issues/48587, I had a hunch. While working on a different project, I had changed some of the Visual Studio Debugging options (just the regular general Visual Studio Tools -> Options -> Debugging -> General).
For another project, I had enabled the![image](https://github.com/dotnet/aspnetcore/assets/22459191/6eed304b-3695-4d5e-a204-a5960f3685ae)
Suppress JIT optimization on module load (Managed only)
. So I had a hunch, and disabled that setting. Without doing anything else, I clicked on the Start Debugging again, and sure enough, it all worked just fine.Expected Behavior
Debugging of Blazor Web Assembly should work with
Supporess JIT optimization on module load
, or a better error message should be displayed saying that it isn't supported. Or there should be documentation saying that it's not supported.Steps To Reproduce
Create a new Blazor WebAssembly Standalone App from the Visual Studio default templates.
Choose .NET 6 as the Framework. (Although not sure if it matters or not. Sorry, I don't have time to do all the testing and debugging for you.)
No authentication is needed.
Configure for HTTPS is checked.
Do not use top-level statements is checked.
Press![image](https://github.com/dotnet/aspnetcore/assets/22459191/42fc719c-e024-469c-b87f-5a9d1c75ca5f)
F5
to build and start debugging the application. The browser should open and the app should load.Close down the browser and stop debugging.
Go to Tools -> Options -> Debugging -> General and enabled the![image](https://github.com/dotnet/aspnetcore/assets/22459191/58c93185-0840-4eea-ae6d-4818d2dc38f6)
Suppress JIT optimization on module load
.Press![image](https://github.com/dotnet/aspnetcore/assets/22459191/26265f72-e5fa-4e6a-8094-81e90b9687aa)
F5
again and you will get the error.Exceptions (if any)
No response
.NET Version
.NET 6
Anything else?
Microsoft Visual Studio Enterprise 2022 Version 17.8.3 VisualStudio.17.Release/17.8.3+34330.188 Microsoft .NET Framework Version 4.8.03761
Installed Version: Enterprise
Architecture Diagrams and Analysis Tools 00476-80000-00000-AA328 Microsoft Architecture Diagrams and Analysis Tools
Visual C++ 2022 00476-80000-00000-AA328 Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.8.358.6298 ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.8.358.6298 Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 17.8.358.6298 Azure Functions and Web Jobs Tools
C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Node.js Tools 1.5.50908.1 Commit Hash:c294679b821c4b8f7f9c6db3827b7655db80fc28 Adds support for developing and debugging Node.js apps in Visual Studio
NuGet Package Manager 6.8.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.8.3.2358002+8c7fb27bf8e8d4f9ff8080b624b35bca5e812e97 Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.8.119.0 Microsoft SQL Server Data Tools
StopOnFirstBuildError 1.0 StopOnFirstBuildError
Stops a solution build immediately after a project has failed to build.
https://einaregilsson.com/stop-build-on-first-error-in-visual-studio-2010/
TypeScript Tools 17.0.20920.2001 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.8.0-beta.23475.2+10f956e631a1efc0f7f5e49c626c494cd32b1f50 Microsoft Visual F# Tools
Visual Studio Spell Check Everywhere VSSpellCheckEverywhere An extension that enables spell checking within any Visual Studio file editor or tool window that uses WPF text boxes. https://GitHub.com/EWSoftware/VSSpellChecker
Visual Studio Spell Checker VSSpellChecker An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with tool windows. https://GitHub.com/EWSoftware/VSSpellChecker![image](https://github.com/dotnet/aspnetcore/assets/22459191/934905b2-cab3-44b5-b4d2-372c96597a78)