Windows was unable to communicate with the target application

When you develop Windows 8 Store apps, sometimes Visual Studio and the debugger process don’t play nice together. You know when it happens. The title bar turns white, applications are not responding and you find yourself trying to kill all hanging processes

It happened to me yesterday and every time I tried to run my app, this is what I got:

activate

I’ve experienced strange Windows Store app errors before and I thought it must have been caused by force-quitting my processes.

XAML problem

It turned out, something else caused the problem. Do you remember what happened if you made resource errors in Silverlight? Most of the time, your screen went white. If you were lucky, the debugger would tell you a resource is missing.

In my case there was also a resource problem that coincided with the debugger hanging!

So what happened? I needed a button style and took it out of the commented section in Common/StandardStyles.xaml and placed it just before the AppBarButtonStyle.

reso

Solution

The SkipBackAppBarButtonStyle was based on AppBarButtonStyle but defined just before AppBarButtonStyle. This is not allowed in XAML! I moved it just below AppBarButtonStyle and everything was fine.