是否可以使用 Windows 应用程序打包项目打包两个 UWP 应用程序? [英] Is it possible to package two UWP Apps using Windows Application Packging Project?

查看:22
本文介绍了是否可以使用 Windows 应用程序打包项目打包两个 UWP 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 UWP 项目,一个用于自定义共享 UI,即 ShareTarget 应用程序和一个主应用程序,两者都是 uwp.

I have two UWP projects, one for a Custom Share UI, which is a ShareTarget App, and a main Application, both are uwp.

而且,我有以下应用程序结构.(本例中的所有示例应用,都是从新项目"创建的,基本上没有任何内容,除了默认内容)

And, I have the following app structure. (All the sample apps in this case, all created from the 'new project' and basically do not have any content in them, except for the default content)

但是,当我构建 WapProjTemplate1 时,我收到以下错误日志,

But, when I build the WapProjTemplate1 I get the following error logs,

错误 APPX1101 负载包含两个或多个具有相同目标路径App.xbf"的文件.源文件:\source\repos\WapProjTemplate1\App1\bin\x64\Debug\App.xbfsource\repos\WapProjTemplate1\App2\bin\x64\Debug\App.xbf WapProjTemplate1 D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.目标 1766

甚至可以有两个应用程序吗?

Is it even possible to have two apps?

我想要两个应用程序的原因是,我想从 ShareUI 调用主应用程序.

The reason I want two apps is because, I want to invoke the main app from the ShareUI.

推荐答案

您不应该有两个单独的应用程序来启用共享.您的主应用程序将在其清单 根据文档.

You shouldn't have two separate apps for enabling Sharing. Your main app will just declare itself as the receptor of Sharing in its manifest as per docs.

然后它将启动(如果它没有运行)或重新激活(如果它是),使用以下 OnShareTargetActivated 事件;

It will then launch (if it's not running) or get re-activated if it is, with the following OnShareTargetActivated event;

protected override async void OnShareTargetActivated(ShareTargetActivatedEventArgs args)

您可以在此处重定向到其他页面,或弹出一个新窗口,其中包含来自共享的数据.

Here is where you can redirect to a different page, or pop open a new window populated with the data from the share.

这篇关于是否可以使用 Windows 应用程序打包项目打包两个 UWP 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆