c# - 是否可以使用 Windows 应用程序打包项目打包两个 UWP 应用程序?
问题描述
我有两个 UWP 项目,一个用于自定义共享 UI,它是一个 ShareTarget 应用程序和一个主应用程序,两者都是 uwp。
而且,我有以下应用程序结构。(本例中的所有示例应用,都是从“新项目”创建的,除了默认内容外,基本上没有任何内容)
但是,当我构建 WapProjTemplate1 时,我得到以下错误日志,
错误 APPX1101 有效负载包含两个或多个具有相同目标路径“App.xbf”的文件。源文件:\source\repos\WapProjTemplate1\App1\bin\x64\Debug\App.xbf source\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.Targets 1766
甚至可以有两个应用程序吗?
我想要两个应用程序的原因是,我想从 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.
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.
推荐阅读
- flutter - 在 swipper 中显示 3 个项目
- php - 在php中使用pdo通过tls连接mysql服务器时是否需要指定证书颁发机构?
- python - 熊猫数据框
- javascript - Next.js + Strapi 博客:内容未更新
- java - Spring boot 如何正确使用@PostConstruct
- android - 如何在flutter中从其他android型号中检测华为设备型号?
- angular - Angular FormBuilder补丁值在编辑后丢失了补丁值
- kotlin - VSCode 不知道 Gradle 项目的依赖关系
- python - 即使字典中的键是键错误?
- powershell - Powershell添加错误字符进行注册