0
votes

I have an app I created in WPF. Current in WPF, I'm using the Microsoft.Win32.SaveFileDialog file picker to let the user select a file location to save to.

I'm in the midst of converting this app to a Windows Store compatible app, via the Desktop App Converter application. When I use the Win32 picker in the UWP-converted app, it just hangs and eventually crashes, so that doesn't seem to be happy.

It looks like there is a UWP-compatible file picker Windows.Storage.Pickers.FileSavePicker, which is available using the Nuget package UWPDesktop.

Unfortunately, this is giving me the following warning -

Type 'Windows.Storage.Pickers.FileSavePicker' can only be used in UWP apps, not Desktop or Centennial

This seems pretty clear to me, so, finally my question is What dialog picker am I supposed to use for a desktop converter UWP app?

Seems like there are 2 options -

  1. There's some kind of 3rd type of file picker that I'm unaware of, that's compatible with both frameworks.
  2. I use some kind of check in the app to see what framework is active (somehow) and use the appropriate file picker.

Thanks in advance!

2
What process are you using to convert the app? Have you tried to make the app a "pure" UWP (using only the new APIs, the new UI, etc.) or are you keeping the WPF app as a Full Trust EXE that's just been packaged as an AppX?Peter Torr - MSFT
The app is basically complete, so I'm sticking with the WPF UI. I'm using the desktop app converter from the windows store to do it. Everything else works but the dialogs. Originally I built custom dialogs, but realistically, I'm fine using the built in ones.chris84948

2 Answers

3
votes

You can continue to use the Win32 picker in your converted WPF app. That is supported and expected to work.

To answer why you are seeing a crash here: If you have Office 2016 installed, there was recently a bug introduced with an Office update that is causing the file picker dialog to crash for converted apps. The fix for this bug should go out very soon in a servicing update.

To confirm that this is indeed the bug you are hitting you can look at the crash reports for your app, and you should see a crash in the module grooveex.dll.

Thanks, Stefan Wick - Windows Developer Platform

0
votes

I ended up building a sample app containing just the problematic dialog in an otherwise empty app, with the plan of sending it to Stefan over MS.

Of course, everything looked good, so I played with it a little more and eventually figured out what might have happened.

I was running some async code just before the dialog was executed, and it looks like that would fail silently, causing the app to hang indefinitely.

I don't think this will help anyone, just wanted to close the loop.