Debugger Breaks to External Files and Exception Handling Issue in C# .NET 8.0 with VS 2022
I am coding my project in .NET 8.0 in the new Visual Studio 2022 Preview version.
Whenever there is an exception within a try catch block, for some reason, the VS debugger breaks and brings me to files which are not from my project, such as:
Exception User-Unhandled:
System.Net.Sockets.SocketException
HResult=0x80004005
Message=The requested name is valid, but no data of the requested type was found.
Source=System.Net.Sockets
StackTrace:
at System.Net.Sockets.SocketAsyncEventArgs.<<DnsConnectAsync>g__Core|112_0>d.MoveNext()
C:\Users\FRZ\AppData\Local\SourceServer\8a3b989d075fe5e6b812cbdd0fa766804632a4fa333c1d383a1867bd743fd652\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs
Not only is the exception not bringing me to my user code, but it is also breaking from within a try catch (handled exception). It should continue executing.
What is going wrong, and how can I fix this?
43 Replies
do you have "Just My Code" enabled
Yes
I am going absolutely crazy over this D:
and, uh, it's not set in your "Break When Thrown" options either, is it
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
Same issue
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I think I'm gonna go with this
This issue has been happening for soo long
And I've cleaned the project/rebuilt so many times
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
but its in a try catch
its handled
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
why would it break?
TeBeCo
delete
.vs/
folder possibly also bin/obj and retryQuoted by
<@689473681302224947> from #Debugger Breaks to External Files and Exception Handling Issue in C# .NET 8.0 with VS 2022 (click here)
React with ❌ to remove this embed.
i would recheck that its handled (even tho im 100% sure)
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
but even the call stack is unreadable
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
it was already off
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
im sure its to do with that
with .net8
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
its just
i have a lot of projects
i will try it later
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
i was just hoping to find some setting that i could turn off
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
where do i find global.json
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
{
"sdk": {
"version": "7.0.302"
}
}
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
thought thats what global.json did 🤔
ok lets try anyway
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yeah, it's good now
fair enough
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
thanks (:
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yeah
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View