Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

c# - How to deploy a Metro App to the Desktop?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...