HotAvalonia uses an IFileSystem to access source files. You can choose from several implementations:
FileSystem.Current: The default. Used when source files are on the same machine as the app.FileSystem.Empty: A no-op fallback.FileSystem.Connect(IPEndPoint, byte[] secret, IFileSystem fallbackFileSystem): Used for mobile/emulator development. Connects to a remote file system server (see HotAvalonia.Remote) to access source files on your development machine.
To use a custom file system, pass it into an AvaloniaHotReloadConfig object, which is then used to create your AvaloniaHotReloadContext instances.
// Connect to a file system server.
IPEndPoint endpoint = new IPEndPoint(IPAddress.Parse("192.168.0.42"), 20158);
byte[] secret = Encoding.UTF8.GetBytes("My Super Secret Value");
IFileSystem fileSystem = FileSystem.Connect(endpoint, secret, fallbackFileSystem: FileSystem.Empty);
// Create a hot reload config.
AvaloniaHotReloadConfig config = AvaloniaHotReloadConfig.Default with { FileSystem = fileSystem };
// Add path hints if needed.
config.ProjectLocator.AddHint(assembly => assembly.GetName().Name == "MyProject" ? "/home/user/projects/MyProject/src/MyProject" : null);
// Provide your customized config to the hot reload context factories.
IHotReloadContext appDomainContext = AvaloniaHotReloadContext.FromAppDomain(config);
IHotReloadContext assetContext = AvaloniaHotReloadContext.ForAssets(config);
// Finally, enable your combined hot reload context.
_context = appDomainContext.Combine(assetContext);
_context.EnableHotReload();