diff --git a/docs/platforms/dotnet/common/troubleshooting.mdx b/docs/platforms/dotnet/common/troubleshooting.mdx index e033884f178ac5..8e758e4e77f95a 100644 --- a/docs/platforms/dotnet/common/troubleshooting.mdx +++ b/docs/platforms/dotnet/common/troubleshooting.mdx @@ -159,6 +159,23 @@ If you're working with obfuscated code, you have several options: 3. **Contribute to Symbolic**: [Our symbolication library is open source](https://github.com/getsentry/symbolic). You could create a ticket to discuss adding support to it with the maintainers. +## Missing or Unhelpful Stack Traces in AOT Compiled Apps + +If you're compiling your application AOT (ahead of time), you may see missing or unhelpful stack traces in Sentry. This can happen because the default stack trace extraction used by the SDK (`SentryStackTraceFactory`) relies on runtime metadata that may not be available in the same way in AOT compiled applications. + +One possible workaround is to use the `StringStackTraceFactory` instead of Sentry's default stack trace factory. The `StringStackTraceFactory` parses stack trace information from the string representations of stack traces and aims to produce at least a minimal set of frames when the default stack trace factory can't. + +To enable it, configure Sentry as follows: + +```csharp +SentrySdk.Init(options => { + // ...All the usual setup + options.UseStackTraceFactory(new Sentry.Extensibility.StringStackTraceFactory(options)); +}); +``` + +This factory is experimental and more limited than the default one. Only enable it if you're not getting useful stack traces with the default configuration. + ## Proxy Server Often, your server can only access the internet through a proxy server.