It seems that after creating a new ChoXmlReader<>, I can no longer catch exceptions specifically with the debugger that would normally crash the program in main. This is interfering with debugging greatly. I can even wrap the function call below in a try-catch and it will catch the exception successfully, but will never pause the debugger with a breakpoint.
var configuration = new ChoXmlRecordConfiguration { ErrorMode = ChoErrorMode.ThrowAndStop };
throw new Exception("Debugger catches this");
var x = new ChoXmlReader<MyType>(path, configuration);
throw new Exception("Uncaught by debugger, shows \"An application error occurred\" in debugger console.");
Tested using Rider as well as Visual Studio 2022 on Windows 10. Full output:
An application error occurred. Please contact the administrator with the following information:
1) Exception Information
*********************************************
Exception Type: System.Exception
TargetSite: LanguageExt.Common.Result`1[InputReader.InputFile] Load(System.String)
Message: Uncaught by debugger, shows "An application error occurred" in debugger console.
Data: System.Collections.ListDictionaryInternal
HelpLink: NULL
Source: XmlSerializer
HResult: -2146233088
StackTrace Information
*********************************************
at InputReader.InputFile.Load(String path) in C:\...\src\XmlSerializer\MxpoInputFile.cs:line 47
at InputReader.InputConfiguration.Load(String path) in C:\...\src\XmlSerializer\InputConfiguration.cs:line 18
at Program.<Main>$(String[] args) in C:\...\src\Runner\Program.cs:line 22
_______________________________________________
It seems that after creating a new ChoXmlReader<>, I can no longer catch exceptions specifically with the debugger that would normally crash the program in main. This is interfering with debugging greatly. I can even wrap the function call below in a try-catch and it will catch the exception successfully, but will never pause the debugger with a breakpoint.
Tested using Rider as well as Visual Studio 2022 on Windows 10. Full output:
Other dependencies in the project:
ChoETL.Core
Akade.IndexedSet
Exceptionless.DateTimeExtensions
IntervalTree
LanguageExt.Core
LanguageExt.Transformers