Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions platform-includes/troubleshooting/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ using SentrySession = Sentry.Session;
```

Then `SentrySession` can be used instead of `Sentry.Session`.

### Visual Studio Hot Restart Incompatibility

Attempting to build a .NET MAUI iOS app will result in an error if you use Visual Studio Hot Restart when developing on Windows with a remote Mac:

> The xcframework sentry.bindings.cocoa\5.0.1\lib\net8.0-ios17.0\Sentry.Bindings.Cocoa.resources.zip has an incorrect or unknown format and cannot be processed.

This happens because Hot Restart does not support static iOS libraries or frameworks containing static libraries, as detailed in the [Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/maui/ios/hot-restart?view=net-maui-9.0#limitations).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aritchie curious, nothing we can do about this?

People need to uninstall Sentry to use Hot Restart?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bruno-garcia We may be able to detect hotrestart in a prebuild step, but I'm not sure. I'll look into it. I wish the tooling gave better error messages in these cases

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seems like we at least need to say then: "To use Hot Restart you'll need to remove the Sentry SDK" if that's the solution. But that's quite sub optimal obviously

Copy link
Contributor

@aritchie aritchie Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is likely some form of condition that can be applied to the package reference and if/def constant you can use in code to remove UseSentry. I'll ask around.

Thoughts

<PackageReference Include="Sentry.Maui" Condition="$(HOT_RESTART) == 'false'" />
#if !HOTRESTART
.UseSentry(...)
#endif

Loading