Skip to content

Adding unsupported hot reload #12683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 26, 2025
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
Collaborator

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
Collaborator

@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