I'm writing an application using Avaloniaui. I'm pretty sure the question is for .NET in general, though. I want the user to be able to specify an app that will be used to open certain file types. In Windows I can just browse to the executable and voilà. In MacOS I can browse to a file and select it, like I would expect. But when I use the filebrowser or drag and drop with an application 'Applications' folder, the result is an empty list (IEnumerable).
public async void OpenFileBrowser(object source, RoutedEventArgs args)
{
var files = await FileBrowserResult("Open Executable", "Executables", "*");
if (files.Count > 0)
{
IStorageFile file = files[0];
Debug.WriteLine("Selected: " + files[0].Path.LocalPath);
}
else
{
Debug.WriteLine("No file selected");
}
}
The same happens for Drag and Drop result. f.y.I, I have not changed any sandbox settings and am developping in VS Code, .NET 8.