UWP中的[UWP] [C#]平台相关插件程序集 [英] [UWP][C#] Platform dependent plugin assemblies in UWP

查看:94
本文介绍了UWP中的[UWP] [C#]平台相关插件程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在开发一个UWP应用程序,我想用插件系统扩展它的功能。我知道WinRT的限制不允许下载第三方程序集并将其用作插件但我仍然允许使用
我的程序包发送其他程序集,但在需要时动态加载它们。这样做的原因是,您应该能够通过混合使用免费和付费的IAP(取决于它们提供的功能)来扩展我的应用程序的功能,因此您可以有效地决定
想要支付应用程序,因为基本应用程序将是免费的,但如果没有任何软件包,它可能不会有很多功能。


然而,由于新的UWP应用程序的构建方式,我必须包括每个配置(x86,x64,ARM)的正确平台程序集。我的问题也存在。如何在构建时告诉VS应该将哪些文件打包到我的appx包中?因为
我不能直接引用项目(如果我这样做,那么程序集将在运行时加载,我想避免,直到真正有必要防止由于加载但(理论上)未使用的程序集造成的内存浪费,如当购买IAP并且应用程序激活插件时,他们才开始提供
他们的东西)我必须通过外部文件夹提供程序集文件,该文件夹也分为三个其他文件夹,分别为x86,x64,ARM,一个对于每个平台。

如果我在不尊重平台的情况下引用每个程序集,它会使应用程序包膨胀,没有人想要这个。每个插件仍将被编译到它的相应平台组件中,但是当打包开始时,只有正确的组件将打包
,这就是我想要的。


我希望这是某种方式可以理解,因为我提供了很多背景信息,我正在努力实现,有人可以帮助我。谢谢你的回答。

解决方案

internetfreak,


> ;>然而,由于新UWP应用程序的构建方式,我必须为每个配置(x86,x64,ARM)包含正确的平台程序集。


如果您有三组不同的程序集,为什么不创建一个Windows运行时组件来包装您的附加块并与多个平台兼容。


参考
打包通用Windows适用于Windows 10的应用


如果您确实需要为不同的平台拆分不同的设置并避免添加引用,我认为这对于当前的机制是不可能的。


这是一份官方文档,说明如何使用最佳实践排除或限制试用版中的功能:
https://msdn.microsoft.com/en-us/library/windows/apps/mt219685.aspx



Hello,

I'm developing a UWP app and I want to extend it's functionality with a plugin system. I know that the limitations of the WinRT do not allow to download third party assemblies and use it as plugin but I'm still allowed to ship additional assemblies with my package but load them dynamically when they are needed. The reason for this is, that you should be able to extend the functionality of my app to your own liking through a mix of free and paid IAPs (depending on what functionality they provide) so you can effectively decide how much you want to pay for the app as the base app will be free but it will probably not feature much things without any package.

However due to the way the new UWP apps are built I have to include the correct platform assemblies for each configuration (x86, x64, ARM). There also lies my problem. How can I tell VS which files it should pack into my appx package at build time? Because I cannot reference the projects directly (if I do that, then the assemblies would get loaded on runtime which I want to avoid until it's really necessary to prevent memory waste due to loaded but (theoretical) not used assemblies, as they only begin to provide their things when the IAP is bought and the app activates the plugin) I have to supply the assembly files through an external folder which is also divided in three other folders named x86,x64, ARM, one for each platform.
If I reference each assembly without respecting the platform it would bloat the application package and no one wants this. Each plugin will be still compiled into it's respective platform assembly but when the packaging begins, only the right assembly will be packaged, that's what I want.

I hope this is somehow understandable as I gave much background info what I'm trying to achieve and someone can help me. Thanks for your answers.

解决方案

Hi internetfreak,

>>However due to the way the new UWP apps are built I have to include the correct platform assemblies for each configuration (x86, x64, ARM).

If you have three different sets of assemblies, why not create a Windows Runtime Component to wrapper your additional blocks and compatible with multiple platforms.

Ref Packaging Universal Windows apps for Windows 10

If you really need to split to different sets for different platform and avoid adding reference, I think this is impossible for the current mechanism.

This is the official document to state how to exclude or limit features in a trial version with best practice: https://msdn.microsoft.com/en-us/library/windows/apps/mt219685.aspx


这篇关于UWP中的[UWP] [C#]平台相关插件程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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