为Vb.net应用程序创建插件 [英] Create Addons for Vb.net application

查看:74
本文介绍了为Vb.net应用程序创建插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为Vb.net应用程序创建插件或不安装完整应用程序的插件如果用户需要点击插件并添加到应用程序

Create Addons for Vb.net application or Plugins that not install full application if user required click on addons and add to application

推荐答案

这是一个非常大的复杂的话题,但它不一定是一项大工作。如果不清楚,请查看我过去对该主题的回答并向我提出进一步的问题:



创建使用Reloadable Plugins的WPF应用程序...... [ ^ ],

AppDomain拒绝加载程序集 [ ^ ],

使用CodeDom生成代码 [ ^ ],

创建使用可重新加载插件的WPF应用程序...... [ ^ ],

动态加载用户控件 [ ^ ],

C#Reflection InvokeMember on existing instance [ ^ ],

项目和DLL':如何保持它们可管理? [ ^ ],

从汇编中收集类型它是字符串表示 [ ^ ]。



首先,看看最后一个答案,因为它描述了最简单的方面它,而且,很有可能,这就是你所需要的。



参见:以编程方式添加参考 [ ^ ]。



现在,简短摘要:插件-in架构很容易实现,如果你需要可加载的插件,但不能重新加载。这是因为.NET中不允许卸载程序集。如果重新加载但未卸载,则会导致强烈的内存泄漏。卸载的唯一方法是使用单独的应用程序域,这些域具有隔离的地址空间并且可以卸载。但是允许卸载的功能变得更加困难,因为IPC是必需的。但这并不是很难,因为Application Domains提供了简化的IPC。



其他一切都取决于您的应用程序要求特有的功能。



-SA
This is a pretty big and complex topic, but it does not have to be a big work. Please see my past answers on the topic and ask me further questions if something is not clear:

Create WPF Application that uses Reloadable Plugins...[^],
AppDomain refuses to load an assembly[^],
code generating using CodeDom[^],
Create WPF Application that uses Reloadable Plugins...[^],
Dynamically Load User Controls[^],
C# Reflection InvokeMember on existing instance[^],
Projects and DLL''s: How to keep them managable?[^],
Gathering types from assemblies by it''s string representation[^].

First of all, look at the last answer, as it describes the simplest aspect of it, and, chances are, this is all you need.

See also: adding reference programmatically[^].

Now, a short summary: plug-in architecture is pretty easy to implement if you need loadable plug-ins, but not reloadable. This is because unloading of assemblies is not allowed in .NET. If you re-load but not unload, it will cause a strong memory leak. The only way to unload is to use separate Application Domains, which have isolated address spaces and can be unloaded. But the feature which allow unloads becomes work much harder, because IPC is required. But this is not extremely hard, because Application Domains provides simplified IPC.

Everything else depends on the featured specific to your application requirements.

—SA


这篇关于为Vb.net应用程序创建插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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