Open yevgeny-sotnikov opened 4 days ago
I can't reproduce any crashes.
I build like this:
$ dotnet build
and then I run from the command line like this:
$ ./bin/Debug/net9.0-macos/osx-arm64/macOSApp1.app/Contents/MacOS/macOSApp1
2024-11-29 22:10:40.716 macOSApp1[39062:3937935] Microsoft.macOS: Invalid IDE Port: -1
2024-11-29 22:10:41.397 macOSApp1[39062:3937904] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
macOSApp1.MyException: I want to get this exception at least at console output, also, i need to handle this exception - app shouldn't crash
at macOSApp1.AppDelegate.DidFinishLaunching(NSNotification notification) in [...]/dotnet-issues/macOSApp1/AppDelegate.cs:line 14
and the app doesn't crash.
How are you launching the app?
How are you launching the app?
I'm running debug build at Rider/VSCode, doesn't matter, with attached debugger. The problem is when execution reaches exception throwing - after that app instantly stops execution and debugger never reach breakpoint at catch block.
By now in this small sample i know what is root cause of such behaviour, but in real, big solution i spent few hours to find root cause, cuz no any information about exception in debug output. To be honest - at this case app mustn't crash at all cuz exception is catched
With .net8 i don't have such issue - all works as expected
Apple platform
macOS
Framework version
net9.0-*
Affected platform version
.net 9.0.100
Description
In debug build app instantly crashes even on expected exceptions wrapped to try-catch block.
No any information neither in debug output, nor at
AppDomain.CurrentDomain.UnhandledException
handler.App crashes without any notification what's happening. On real project it's real problem cuz it blocks development
Steps to Reproduce
Did you find any workaround?
No
Relevant logs
No response