Skip to content

[WindowsDesktop] OpenFileDialog.ShowDialog() hangs with return await rootCommand.InvokeAsync(args); #2265

@abdeldjalil-fellah

Description

@abdeldjalil-fellah

OpenFileDialog.ShowDialog() hangs in MainForm with:

[STAThread]
static async Task<int> Main(string[] args)
{
            var rootCommand = new RootCommand();
            rootCommand.SetHandler((context) =>
            {
                Application.Run(new MainForm());
            });
            return await rootCommand.InvokeAsync(args);
}

but works well with:

[STAThread]
static int Main(string[] args)
{
            var rootCommand = new RootCommand();
            rootCommand.SetHandler((context) =>
            {
                Application.Run(new MainForm());
            });
            return rootCommand.Invoke(args);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions