Skip to content

OpenFileDialog / SaveFileDialog will shutdown WPF application with Error #10318

Closed as duplicate

Description

@samanoudi

Description

have an issue using OpenFileDialog/ SaveFileDialog in .NET 9.0 WPF Application. When shown the Dialog and hovering/clicking with the mouse on the Drive selection parts the WPF app will exit with the following error :

The program '[32780] WPFTESTS.exe' has exited with code 3221226505 (0xc0000409).

Image

Note: Using the Quicklinks, and Selecting Files is working without any Errors. Reverting the Application to Target .NET 8 the error will go away. This is calling method.

Reproduction Steps

private void Button_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog f= new OpenFileDialog();
f.ShowDialog();
}

Expected behavior

Opening a FielDialog and selecting drives, folder and files

Actual behavior

App Shuts down with Error

Regression?

.Net8

Known Workarounds

No response

Configuration

Windows 11
Net9 var 9.102

Other information

No response

Activity

  1. filipnavara commented on Jan 19, 2025

    @filipnavara
    Member

    This could be caused by a 3rd-party shell extension, possibly in tandem with the CET stack protection that is enabled by default for all .NET 9 apps. Can you enable the Windows Error Reporting to produce a memory dump for the crash (https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps)? That can be analyzed to find the culprit.

  2. lindexi commented on Jan 20, 2025

    @lindexi
    Member

    @samanoudi Sorry, I can not repro your issues in my WPF demo. And I agree with @filipnavara .

    By the ways, you can fire the wpf issues to https://github.com/dotnet/wpf/issues

  3. h3xds1nz commented on Jan 20, 2025

    @h3xds1nz
    Member

    This would a duplicate of #10305 then.

    I wonder, is dotnet/runtime#109548 out yet? Milestone is set to 9.0.2. Given the shadow stack fail with FAST_FAIL_SET_CONTEXT_DENIED.

  4. filipnavara commented on Jan 20, 2025

    @filipnavara
    Member

    This would a duplicate of dotnet/wpf#10305 then.

    Yep, looks like the same issue.

    I wonder, is #109548 out yet? Milestone is set to 9.0.2. Given the shadow stack fail with FAST_FAIL_SET_CONTEXT_DENIED.

    No, it's not out yet. 9.0.2 will be released on February 11, 2025. (SDK 9.0.103 or 9.0.200)

    You can check the commit history of https://github.com/dotnet/runtime/commits/v9.0.1/ and see that it didn't make it to 9.0.1.

  5. h3xds1nz commented on Jan 20, 2025

    @h3xds1nz
    Member

    No, it's not out yet. 9.0.2 will be released on February 11, 2025. (SDK 9.0.103 or 9.0.200)

    You can check the commit history of https://github.com/dotnet/runtime/commits/v9.0.1/ and see that it didn't make it to 9.0.1.

    Felt easier to ask, not gonna lie.

  6. lindexi commented on Jan 22, 2025

    @lindexi
    Member

    @samanoudi Could you try #10305 (comment) ?

    <CETCompat>false</CETCompat>

  7. added
    InvestigateRequires further investigation by the WPF team.
    and removed on Jan 22, 2025
  8. samanoudi commented on Jan 29, 2025

    @samanoudi
    Author

    @lindexi That is the solution

  9. lindexi commented on Feb 5, 2025

    @lindexi
    Member

    @samanoudi You can update the dotnet and re-enable the CETCompat by <CETCompat>true</CETCompat>, after dotnet/runtime#109074 or dotnet/runtime#109548 merged.

  10. h3xds1nz commented on Feb 5, 2025

    @h3xds1nz
    Member

    Basically with 9.0.2 release which should be mid this month.

  11. h3xds1nz commented on Feb 12, 2025

    @h3xds1nz
    Member

    @samanoudi Could you please re-test on .NET 9.0.2 (released yesterday) runtime without disabling CET on the project?

  12. LWChris commented on Jun 22, 2026

    @LWChris

    FYI, I still got that crash in an app compiled with <TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>. Installed .NET 9 runtimes are only .NET 9.0.16 and .NET 9.0.17 according to dotnet --list-runtimes.

    It occurred when I tried to open the context menu of a file from within an OpenFileDialog. Opening the context menu on the folder background worked.

    From the event viewer:

    Faulting module name: ntdll.dll, version: 10.0.26100.8328, timestamp: 0x0022b8e0
    Exception code: 0xc0000409
    Fault offset: 0x0000000000120fe6

    Adding <CETCompat>false</CETCompat> to the csproj still resolves the issue.

    This crash may be caused by some third-party context menu extension, of which there are several installed on my laptop (managed by the company). Most notably "TortoiseSVN", "BeyondCompare", and "Adobe PDF", but also several from Microsoft products.

    I'm not sure from the mentioned issues if this should've been resolved with .NET 9.0.2 or if that resolved some .NET internal problem and cannot fix the OpenFileDialog problem.

  13. h3xds1nz commented on Jun 22, 2026

    @h3xds1nz
    Member

    I've explained it here:

    #10305 (comment)
    #10483 (comment)

  14. jkotas commented on Jun 23, 2026

    @jkotas
    Member

    Duplicate of #10305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvestigateRequires further investigation by the WPF team.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions