EXE作为要嵌入在Web窗体中的插件 [英] EXE as Plugin to be emedded in Web Form

查看:161
本文介绍了EXE作为要嵌入在Web窗体中的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道是否可以将独立应用程序(以Exe文件的形式)添加为Web窗体的插件吗?我对Web编程不太熟悉.

这是一个非常非常糟糕的主意;并且您不能将其称为插件.我认为您的意思是* .EXE文件是外部应用程序的单独过程.但是进程之间的隔离度很高,因此插件"与其主机之间的通信必须通过IPC(进程间通信)进行,这完全无法实现插入的目的.

您确实需要基于同一过程以及将程序集动态加载到同一过程(主机应用程序之一)来开发插件体系结构.在这种情况下,应将插件程序集用作类库.

重要的是要理解,在.NET中,EXE和DLL文件之间没有本质区别,它们都是程序集或程序集的模块(您通常看不到模块,因为Visual Studio仅支持创建单模块程序集. ,但您也可以开发多模块程序集;不要将模块与引用的程序集混合;模块是组成程序集的独立可执行文件).因此,它们只是可执行模块,而EXE或DLL只是文件名的一部分(我不想说扩展名",因为在现代文件系统中不存在扩展名",它们只是旧DOS的残余物)和FAT扩展名",目前仅是Shell使用的命名约定).

就是说,EXE文件可以作为库引用,就像DLL或用作程序集主要可执行模块的任何其他.NET可执行文件一样.从这个意义上说,EXE仍然可以按照我描述的方式用作插件,但是使用EXE命名约定只是没有多大意义.

我在过去的答案中详细解释了如何开发插件体系结构.请参阅:
创建使用可重载插件的WPF应用程序... [^ ],
AppDomain拒绝加载程序集 [动态加载用户控件 [在现有实例上的C#反射InvokeMember [项目和DLL:如何使其可管理? [ ^ ].

这些过去的答案可以使您对它的一些应用有所了解:
使用CodeDom生成代码 [创建使用可重载插件的WPF应用程序... [ ^ ].

—SA


Hi,
I want to know whether it''s possible to add standalone application (which is in the form of Exe file) to be added as a plugin into web forms?I am not much familiar with Web programming.

解决方案

This is a very, very bad idea; and you cannot call it plug-in. I think you mean *.EXE file as a separate process of an external application. But processes are well isolated, so communication between a "plug-in" and its host will have to be via IPC (inter-process communication), which totally defeats the purpose of plugging.

You really need to develop plug-in architecture based on the same process and dynamic loading of the assemblies to the same process, the one of the host application. In this case, the plug-in assemblies should be used as class libraries.

It is important to understand, that in .NET there is no essential difference between EXE and DLL files, they are all assemblies or the modules of assemblies (you normally don''t see modules because Visual Studio only supports creation of single-module assemblies, but you can develop multi-module assemblies as well; don''t mix modules with referenced assemblies; a module is a separate executable file composing the assembly). So, they are just executable modules, and EXE or DLL are just part of file names (I don''t want to say "extensions", because "extensions" do not exist in modern file system, they are just remnants of old DOS and FAT "extensions", presently only naming conventions used by the Shell).

That said, EXE file can be referenced as a library, exactly as DLL or any other .NET executable file serving as a main executable module of the assembly. In this sense, EXE can still be used as a plug-in in the sense I describe, but using EXE naming convention just does not make a lot of sense.

I explain how to develop plug-in architecture in detail in my past answers. Please see:
Create WPF Application that uses Reloadable Plugins...[^],
AppDomain refuses to load an assembly[^],
Dynamically Load User Controls[^],
C# Reflection InvokeMember on existing instance[^],
Projects and DLL''s: How to keep them managable?[^].

These past answers can give you some idea on some applications of it:
code generating using CodeDom[^],
Create WPF Application that uses Reloadable Plugins...[^].

—SA


这篇关于EXE作为要嵌入在Web窗体中的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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