如何将 Metro 应用程序部署到桌面?

How to deploy a Metro App to the Desktop?(如何将 Metro 应用程序部署到桌面?)

本文介绍了如何将 Metro 应用程序部署到桌面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 C# 应用程序部署到我的 Windows 8 Metro 桌面.我可以在 bin 文件夹中看到已部署的文件,但是当我尝试打开它们时出现以下错误:

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:

此应用程序只能在 AppContainer 的上下文中运行.

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

  • 部署应用程序并将其安全上下文设置为 AppContainer ?
  • 在 AppContainer 上下文中运行应用程序?
  • 将应用程序直接部署到我的 Metro 桌面?

但我不知道如何解决这个问题,因为我在文档中找不到错误.

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

推荐答案

Metro 风格的应用程序并不意味着作为普通应用程序运行.如果要运行自己编写的应用程序,可以执行以下操作之一:

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. 从 VS 运行它(带或不带调试).这实际上会安装您应用的未打包版本,因此您会在开始屏幕中看到它.
  2. 创建要在本地使用的包.您可以在 VS 中通过转到项目 → 商店 → 创建应用程序包 → 构建仅在本地使用的包来执行此操作.这将创建一堆文件,包括一个将实际安装应用程序的命令行脚本.您可能可以使用此方法分发应用程序,但它仅适用于支持开发人员的计算机.
  3. 将您的应用发布到应用商店.这是您将应用分发给普通用户的唯一方法.
  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.

这篇关于如何将 Metro 应用程序部署到桌面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何将 Metro 应用程序部署到桌面?

基础教程推荐