如何部署一个城域应用到桌面?桌面、城域

2023-09-02 10:26:13 作者:泪湿孤枕

我想部署我的C#应用​​程序,以我的Windows 8地铁桌面。我可以看到部署的文件在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环境中的应用? 直接将应用程序部署到我的地铁桌面?

不过,我不知道如何处理这个,因为我无法找到的文档的错误。

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:

从VS(带或不带调试)运行它。这实际上将安装您的应用程序包装的版本,所以你会看到它在启动画面。 创建一个包在本地使用。您可以通过将存储→创建应用程序包→构建一个软件包只使用在本地VS做到这一点。这将创建一批文件,其中包括一个命令行脚本,实际安装应用程序。你可能的可以的使用此方法来分发应用程序,但它只是将工作在开发功能的电脑。 在发布您的应用程序的商店。这是你应该使用分发应用程序,以普通用户的唯一途径。 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. Create a package to use locally. You can do this in VS by going to 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. Publish your app to the Store. This is the only way you should use to distribute the apps to ordinary users.