Andrej Tozon's blog

In the Attic

NAVIGATION - SEARCH

Share charm stopped working while debugging Windows Store app?

An important part of working on Windows Store apps is implementing a Share contract, which allows your app to share parts of its content with other installed apps. Those apps then act as an extension to your app, taking that content and implementing them in different ways, e.g. the Mail app will include it in the body of a new mail or an attachment, twitter and Facebook clients will post it on your timeline, etc.

Debugging your Search contract code can, however, result in system-wide shutdown of the service, meaning that no Windows Store app can share any content with other apps anymore. In such case, instead of getting a list of apps, that are available to share, you’ll be notified that:

Something went wrong with Share. Try again later.

Typically, this happens when you stop debugging (in Visual Studio) while in DataTransferManager’s DataRequested event handler. And this can happen a lot, if you’re not careful Smile

OK, here’s what you do if it does happen. [tl;dr; Restart Explorer]

1. Open Task Manager
2. Select the Details tab
3. Find Explorer.exe (easiest to sort by Name)
4. End Task (button in right lower corner will do the job).
- don’t be afraid when your taskbar disappears, you’ll get it back
5. Select File –> Run new task
6. Type Explorer.exe in the input box
7. Press OK (and taskbar is back)

Your Share charm should be working again.