Whilst developing Metro-style applications (quite possibly limited to XAML apps) you may be unfortunate enough to receive the error message “Unable to Activate Windows Tailored Application” when you try to run the application from Visual Studio. You’ll probably find that other applications that worked previously still do so, but this one won’t budge. In my case, the only additional information was the message: “The remote procedure call failed” and a message in the Output window to say that the program exited with code -1073741819 (0xc0000005).
This has been experienced by a few people and the following have been reported as solutions:
- Running at a screen resolution higher than 1024×768.
This is the minimum resolution for Windows 8 Metro-style apps.
- Creating a new project and migrating the existing files.
- Fixing errors in the application manifest.
These may not be reported at compile/deploy time, but if you double-click on the Package.appxmanifest file, an error indicator is shown in the relevant tab.
- Ensuring that you only have one merged resource dictionary.
This is completely weird and was actually my problem!
Stick to One Merged Resource Dictionary
As mentioned above, my solution was to do with merged resource dictionaries. As with many projects that I’ve worked on, my application resources were split into separate resource dictionaries: one for brushes and one for styles. These were then added in App.xaml as follows:
<Resources/>section in MainPage.xaml, removed the entry from App.xaml and hey presto! My app now builds, deploys, and runs without error.