adospace / reactorui-maui

MauiReactor is a MVU UI framework built on top of .NET MAUI
MIT License
588 stars 49 forks source link

Unable to hot reload maccatalyst #204

Closed alex-relov closed 8 months ago

alex-relov commented 8 months ago

Hello! Thank you for the great library! I have problem with hot reload for maccatalyst

my-new-project % dotnet maui-reactor -f net8.0-maccatalyst      
MauiReactor Hot-Reload CLI
Version 2.0.23.0
Press Ctrl+C or Ctrl+Break to quit
Setting up build pipeline for my-new-project project...done.
Monitoring folder '/Users/alex/source/test/my-new-project'...
Detected changes to 'Pages/MainPage.cs'
Replacing syntax tree for: Pages/MainPage.cs
Connecting to Hot-Reload server (Port: 45821)...Unable to hot reload the application:
System.Net.Sockets.SocketException (61): Connection refused
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Sockets.TcpClient.CompleteConnectAsync(ValueTask task)
   at MauiReactor.HotReloadConsole.HotReloadClient.SendAssemblyFileToServer(MemoryStream stream, MemoryStream pdbStream, CancellationToken cancellationToken) in D:\a\reactorui-maui\reactorui-maui\src\MauiReactor.HotReloadConsole\HotReloadClient.cs:line 297
   at MauiReactor.HotReloadConsole.HotReloadClient.ConnectionLoop(CancellationToken cancellationToken) in D:\a\reactorui-maui\reactorui-maui\src\MauiReactor.HotReloadConsole\HotReloadClient.cs:line 154

but with iOS hot reload works perfectly

adospace commented 8 months ago

Hi, sorry for the late reply.

Maybe it's a permission problem, can you ensure that the app is not running under sandbox: Platforms->MacCatalyst->Entitlements.plist

        <key>com.apple.security.app-sandbox</key>
        <false/>

You must set it to true again when you publish to the app store

alex-relov commented 8 months ago

This solved my problem, thanks!