KEMBAR78
Access Violation and app crash when trying to debug Application.Current · Issue #7050 · microsoft/microsoft-ui-xaml · GitHub
Skip to content

Access Violation and app crash when trying to debug Application.Current #7050

@mattleibow

Description

@mattleibow

Describe the bug

I noticed that my app was crashing when trying to read the resources from a background thread:

var res = Application.Current?.Resources

I don't actually want to start using things, but rather I wanted to get the dispatcher queue and then enqueue a delegate to update the dictionary. But, it appears just reading this crashes the app and also adding Application.Current in the IDE's debug intermediate window also throws.

Steps to reproduce the bug

On a background thread:

var res = Application.Current?.Resources

Expected behavior

No crash and the resource dictionary is readable.

Screenshots

No response

NuGet package version

1.0.0

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 21H2 (22000)

IDE

Visual Studio 2022-preview

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions