36

I am trying to deploy my C# app to my Windows 8 Metro desktop. I can see the deployed files in the bin folder but when i try to open them i get the following error:

This application can only run in the context of an AppContainer.

I checked the properties context menu and i searched through both the manifest and the project settings files.

I think the solution is one of the following

  • deploy the application with its security context set to AppContainer ?
  • run the application in the AppContainer context ?
  • deploy the application directly to my metro desktop ?

But I have no clue how to approach this as I can't find the error in the docs.

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
BentOnCoding
  • 27,307
  • 14
  • 64
  • 92

1 Answers1

48

Metro-style apps aren't meant to be run as ordinary applications. If you want to run an application you wrote, you can do one of the following:

  1. Run it from VS (with or without debugging). This will actually install unpackaged version of your app, so you will see it in the start screen.
  2. Create a package to use locally. You can do this in VS by going to Project → Store → Create App Package → Build a package to use only locally. This will create a bunch of files, including a command-line script that will actually install the app. You probably could use this method to distribute the app, but it would work only on developer-enabled computers.
  3. Publish your app to the Store. This is the only way you should use to distribute the apps to ordinary users.
johnnyRose
  • 7,310
  • 17
  • 40
  • 61
svick
  • 236,525
  • 50
  • 385
  • 514
  • 3
    Is the AppContainer basically the Metro environment? Also, would you be able to create an AppContainer and have that launch your app? – Ciaran Jun 10 '12 at 20:29
  • Also note that the Create App Package option will be disabled until you select the project in Solution Explorer. – Justin R. Apr 24 '13 at 18:30
  • Boy, that makes things a little harder to send to beta testers. (Yes, yes, [I know](https://msdn.microsoft.com/en-us/library/windows/apps/mt185377.aspx), but that's a lot of rigmarole for the first beta.) – ruffin Feb 05 '16 at 15:24