Source code in stacktrace for C#

Does Sentry support showing source code in the stacktrace of an event?

Well no replies from Sentry yet. I’ve sent this to support yesterday but no reply from them either. Maybe the community can help me answer this.

I am two days into my trial and just want to know if Sentry can show the source code within the stack trace in the Events screen, or if that isn’t supported.

I posted a similar question in May (specifically with C# in mind, but left the question more open) and have yet to recieve a response. So far it seems like it may only be implemented for Javascript and python, and I think yours is the only other question I’ve seen about this, so I’m not optimistic that it exists yet.

They replied via email - C# is not supported. It is annoying how vague their marketing material was though. I got the impression it was more than just JavaScript.

Hi Jam. Sorry I missed this thread.
It’s correct at the time we don’t support source context for C# events.
That is a feature we’d love to add eventually.
I’m curious in how you’d like to make your source available to Sentry.

Would you be OK with uploading your source to Sentry?
Or would you rather bundle the source inside the PDB of your app?
Another solution would be to use sourcelink. In which case Sentry would need access to your source control server.

1 Like

@bruno-garcia personally I could see the benefits of either of the methods you mentioned above.
I like the idea of offloading the processing of the data to sentry, so I’m personally a fan of either uploading my source or uploading pdbs that can be mapped to stack traces on the server side. But for me at least the easiest method would be the best IMHO.

I was also initially under the impression that the Azure DevOps integration was able to map the source code via the commits integration, which I still think would be a good way to do it (from an ease of setup standpoint) if it’s possible.

Before I figured out it did nothing, as part of my build process I used the sentry cli to upload my “sourcemaps” (i.e. just the .cs files) to my on-prem server, so that could also be a potential option too. However, I did run into issues where it would take upwards of 20 minutes to upload the source for a larger project, so it’s not without downsides.