Search code examples
c#wpfopenfiledialogsavefiledialogfiledialog

OpenFileDialog causes WPF app to crash


In my WPF Application I used OpenFileDialog to select an image and load it to app, this works fine as expected.

But if I run same app from a flash drive, image loades after that UI freezes, any clicks on UI makes app to crash.

I have admin manifest to app also.


Solution

  • Here In this case OpenFileDialog will cause the app to hang and crash.

    So moved OpenFileDialog to a new thread. And everything works fine.