Open arsinclair opened 4 years ago
@arsinclair What you are describing sounds expected -- the debugger stops with justMyCode
enabled because the exception was "user unhandled" (the exception travelled through your code and was caught by library code). If you turn off Just-My-Code then there is no such thing as user code and therefore there is no such thing as user-unhandled. Since the framework is catching your exception the only way to stop on it is to break on all thrown exceptions.
I am transitioning from VS to VS Code and might not be familiar with how things are, so please correct me if I am wrong.
In my understanding, if I turn on All Exceptions the IDE will pause on all exceptions, including those that are 'try-caught' by the code. And if I use User-Unhandled Exceptions but not All Exceptions, I would imagine that I should see all exceptions, except those that are 'try-caught'. Am I right here?
I understand with your last comment that this problem probably shifts now to a different domain, that is not related to OmniSharp, so if this is the matter, please feel free to point it out.
My case with the debugging configuration is the following: there's my code that throws exceptions and I want to pause on them (this is a legit reason to use justMyCode = true), however there's also bunch of vendor code that throws exceptions I want to pause on, which are not propagated if justMyCode = true.
So how can I achieve what I want?
Issue Description
Debugger doesn't pause on exceptions in
.razor
files when justMyCode setting is set to false.Steps to Reproduce
Just download the demo project DemoTheProblem.zip
Or follow the steps below:
Preparation
Add the following razor code to the page
This code should throw an exception, because selectedEntity is never set.
Reproduction
In the breakpoints section, All Exceptions is unticked, and User-Unhandled Exceptions is ticked.
Expected Behavior
I think VSCode should break on any unhandled exception, just like Visual Studio. It is strange that this behaviour is bound to justMyCode setting. Maybe I am doing something wrong?
This problem somehow reminds me about #3369
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.46.1 C# Extension: 1.22.1
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.301 Commit: 7feb845744 Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/3.1.301/ Host (useful for support): Version: 3.1.5 Commit: 65cd789777 .NET Core SDKs installed: 3.1.301 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |auto-using|Fudge|0.7.15| |blazorsnippets|ScottSauber|1.3.0| |csharp|ms-dotnettools|1.22.1| |vscode-css-formatter|aeschli|1.0.1| |vscode-peacock|johnpapa|3.7.2| |yarn-ui|xqchen|0.1.2|;