realm-dotnet icon indicating copy to clipboard operation
realm-dotnet copied to clipboard

Wrappers not found in hot restart-enabled build for MAUI

Open nirinchev opened this issue 3 years ago • 5 comments

A customer has provided us with a repro for a crash happening when building an app with hot restart enabled. It can be found at https://github.com/rsteinbakk/Realm-MAUI-Iphone-HotRestart-Issue and the problem happens when you build and deploy from a windows machine. It doesn't happen when I build on my Mac (though that doesn't have hot restart enabled, so that could be why). When we try to lookup anything from the wrappers we get a dllnotfound exception. What's interesting is that an .ipa built with hot reload has a bunch of .dlls and native dependencies stuffed in AppName.content folder, while a properly built .ipa will have those in a Frameworks folder.

nirinchev avatar Dec 19 '22 22:12 nirinchev

Hot Reload != Hot Restart.

They are 2 different technologies.

Hot Restart uses a prebuild/presigned app from Microsoft that plays the role of a client displaying things, and VS plays the role of a server serving this client. It has much more limitations than standard hot reload.

Hot Reload uses an xcode fresh built app, and adds a client for the VS hot reload server.

Maybe fixyour issue title ?

softlion avatar Apr 02 '23 10:04 softlion

Good point - I'll update the issue.

nirinchev avatar Apr 16 '23 01:04 nirinchev

Is there any workaround for this?

pikausp avatar May 18 '23 08:05 pikausp

Not at the moment.

nirinchev avatar May 30 '23 08:05 nirinchev

see https://learn.microsoft.com/en-us/dotnet/api/system.reflection.metadata.metadataupdatehandlerattribute?view=net-8.0 to get hot reload notifications in app.

softlion avatar May 30 '23 12:05 softlion