Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix reload to restart
  • Loading branch information
rodolfoBee authored Feb 12, 2025
commit 987dadea07ff1022866e981484495ad35d247138
6 changes: 3 additions & 3 deletions platform-includes/troubleshooting/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ using SentrySession = Sentry.Session;

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

### VS Hot Reload isn't compatible with static assemblies
### VS Hot Restart isn't compatible with static assemblies

Choose a reason for hiding this comment

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

- ### VS Hot Restart isn't compatible with static assemblies
+ ### Visual Studio Hot Restart Limitation
- ### VS Hot Restart isn't compatible with static assemblies
+ ### Visual Studio Hot Restart Incompatibility

A bit more concise.


Attempting to build a .NET MAUI iOS app will result in an error if you use Visual Studio Hot Reload when developing on Windows with a remote mac:
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 Reload 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).
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