ATTENTION: If anyone have even the slightest idea of how to accomplish this, please write an answer :)
How can I enable a feature such that filename and line number of each exception is captured in the stacktrace displayed in the azure function console window when debugging. Or even better, how can I hit a debug breakpoint inside Visual Studio when debugging an azure function?
I have tried enabling debugging information = full, inside project settings -> build -> advanced -> debugging information = full, but this did not have any effect.
Here is some code that will generate an index out of bounds exception which showcases the problem:
List<string> test = new List<string>();
Console.WriteLine(test[0]);
When I run the azure function in debug mode and hit the exception this is the generated output of the console window:
[2020-10-02T13:01:38.289] Executed 'Function1' (Failed, Id=180bf39f-1b60-401e-80a4-2073de926e9e, Duration=340ms)
[2020-10-02T13:01:38.290] System.Private.CoreLib: Exception while executing function: Function1. System.Private.CoreLib: One or more errors occurred. (Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')). System.Private.CoreLib: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index').
Here is the Host.json file from the project:
