Skip to content

Cannot show "open file dialog" window issue in WPF Apps #2663

@DotNetAppCompatFeiWang

Description

@DotNetAppCompatFeiWang
  • .NET Core Version: 5.0.100-preview.1.20125.9
  • Windows version: Windows 10 1809
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: No
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
  • Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.

Problem description: Click Open File dialog button on the app.

Actual behavior: Messagebox says "Cannot show a file dialog unless application is running in UserInterActive mode "

Expected behavior: Open file dialog window show.

**Minimal repro:**using Microsoft.Win32;

private void button_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
try
{
openFileDialog.ShowDialog(); // Exception on this line
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

More detail and repro machine could be found at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1074622

We are testing this app https://github.com/NuGetPackageExplorer/NuGetPackageExplorer and most WPF apps affect by this issue.
@dotnet-actwx-bot FYI

Metadata

Metadata

Labels

BugProduct bug (most likely)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions