Getting the SentryID from new .net SDK

In the legacy RavenSharp SDK, CaptureEvent/CaptureException would return a SentryID which users could give us to help isolate their issue, the new sdk returns a Guid, but this isn’t searchable on sentry, does anyone know of any solutions as I can’t find anything in documentation.

Hi @Haydndias!

Both in the old SDK and the new we return the Sentry Id. The difference is in the .NET type:
In the old SDK we returned a string. Which means that everytime we sent out an event we created a Guid and then called ToString("n") to return the string representation of the Guid without dashes. This means that every event we sent out will allocate that string even if unused.

On the new SDK we return the actual Guid. This way we avoid allocating the string in case the caller is actually interested in working with the Guid or not dealing with the Id at all.

Now the issue is that by default, in .NET, calling ToString() on a Guid will return you the format with dashes between the segments of the Guid. Sentry is expecting Ids not to include these dashes so to transform a .NET Guid to a Sentry Id string you need to call ToString("n").

I’ve raised an issue on the repository GitHub page to improve this:
https://github.com/getsentry/sentry-dotnet/issues/139

Fantastic, thank you!