locked
Unable to activate Windows Metro style application

    Question

  • I hit this problem - I can't launch my app in Visual Studio 11 Beta. It just won't run. After I click the Debug button on VS, the app splash screen will show, then after around 0.5 sec it shows error message "This application could not be started. Do you want to view information about this issue?" Clicking Yes or No has no different - it shows another message "Unable to activate Windows Metro style application xxxxx-xxx-xxxxxxxxxxx!App".

    Here're more information:

    1. The EXACT SAME project works in my Virtual Box's Windows 8. But I can never run it in when I boot my computer into native Windows 8.
    2. I'm running Windows 8 Consumer Preview, not the Developer Preview.
    3. Screen resolution is 1920x1080 (I read some similar threads that says the resolution is the problem)
    4. If I create a new project on the machine, and then COPY AND PASTE the code from my VM's project to the new project, it works.
    5. But I can run Microsoft's app sample without any problem, so there HAS to be a way to run codes built from another machine.
    6. I ask this because I'm working with my friend to create an app, this issue means we must copy and paste the other's code into the local project.
    7. Digging into Windows Event Viewer, I found the following logs that exactly match the time I hit the error: "The server App did not register with DCOM within the required timeout", Source is DistributedCom, Event ID is 10010.
    8. The Immersive-Shell log under App & Service Logs / Microsoft / Windows shows a "Activation of the Metro style application xxxx-xxx-xxx!App for the Windows.Launch contract failed with error: Server execution failed" error.
    9. The App class constructor is never hit, meaning that the system failed to launch any C# code.
    10. Project is C# + Silverlight.

    Anyone who is encountering similar issue? I've tried very hard to dig into the .sln and .csproj files and compare different lines between the "imported" VM project, the locally created project, and Microsoft's app sample projects, with no luck.

    I wish someone has a solution!


    [EDIT: I've just found something new: if I create a metro app solution under the path "C:\Users\USER_NAME\Documents\Visual Studio 11\Projects", I can run it. If I create a metro app under some random folder (say K:\), it won't. Why?]
    • Edited by kayson Monday, April 2, 2012 8:45 PM new info
    Monday, April 2, 2012 8:30 PM

Answers

  • I've further tracked down the problem to this: K drive is a attached VHD file. If I attempt to run the project there it will always fail. But if I copy the project files from K drive to somewhere in MyDocuments, it runs. Question is why? The attach VHD feature is suppose to make it work like a normal hard disk.
    • Marked as answer by kayson Thursday, April 5, 2012 6:12 PM
    Wednesday, April 4, 2012 6:03 PM

All replies

  • Question on the k: drive in your example. Is it a removable storage device, mapped network drive, local hard drive or subst drive?

    If you create a project in another folder on c: it fails there as well?


    David Lamb

    Wednesday, April 4, 2012 3:12 PM
    Moderator
  • I've further tracked down the problem to this: K drive is a attached VHD file. If I attempt to run the project there it will always fail. But if I copy the project files from K drive to somewhere in MyDocuments, it runs. Question is why? The attach VHD feature is suppose to make it work like a normal hard disk.
    • Marked as answer by kayson Thursday, April 5, 2012 6:12 PM
    Wednesday, April 4, 2012 6:03 PM
  • Hello,

    thanks for the details on the K: drive.  I have found a bug that the product team says is fixed in future builds of Windows.  Apparently, this is a security issue - the product team didn't want appcontainers to potentially gain access to file systems that they shouldn't have access to.   I'll check if there is a way to give appcontainers the ok to access the vhd for the consumer preview.

    thanks!

    mike

    Thursday, April 5, 2012 6:10 PM
    Moderator
  • Mike,

    Thank you for that. If the product team cannot fix this issue, at least they should give a more specific error message. I literally spent nearly 12 hours to troubleshoot this one. I'm sure a better error message will save other developers a lot of time.

    Thursday, April 5, 2012 6:15 PM
  • It happened with me. I had copied the project files to Dropbox and tried to open from there. Apps only run from the projects folder. I'm okay with that... but should display a message of warning!
    Tuesday, September 18, 2012 5:19 PM
  • The problem is still there with Windows 8.1 preview.

    In my case the drive is local, created by TrueCrypt.

    Are there any plans to fix it?


    Raffaele Rialdi [MVP] My articles and videos: http://www.iamraf.net Italian blog: http://blogs.ugidotnet.org/raffaele

    Tuesday, July 9, 2013 4:13 PM