问题描述
我激活使用MAF我的插件 - 在一个单独的进程[托管加载在框架。
I activate my plugin using MAF[Managed Add - In Framework] in a separate process.
的问题是,它给默认名称AddInProcess32到每个 插件,它作为一个单独的进程中运行。
我可以给一个自定义的名称,其中MAF创造的过程?如果是的话怎么样?
PS:为什么我想给自定义名称?因为我不希望用户误杀掉进程...我想给的过程,表明它是我的应用程序的一部分,显然是一个名字。的
PS: Why i want to give custom name? Because i do not want user to kill process by mistake...I want to give process a name which shows it is part of my app clearly.
推荐答案
虽然可取的确,这是不幸的是不可能的,因为正确地Dos095,拉斯已经在他的回答同一个问题的(+1那边)。
While desirable indeed, this is unfortunately not possible, as analyzed correctly by Dos095-russ already in his answer to the identical question How to specify AddIn process names? (+1 over there).
为了使赏金值得你有点起码,我会添加一些情况下,虽然:
To make the bounty worth your while a bit at least, I'll add some context though:
在名对于该过程中的截止到非常宗旨类已被设计为,即的提供[S]外部进程运行插件输出的过程从主机应用程序的。具体机制感动在说明的部分:
The Filename for that process is hardcoded in the constructor of the AddInProcess Class due to the very purpose the class has been designed for, namely to Provide[s] an external process for running add-ins out-of-process from the host application. The specific mechanics are touched in the Remarks section:
在运行加载项的可执行文件的两个文件之一获得 在Windows目录下的.NET框架安装。通过 缺省情况下,相匹配的主机的位每字可执行 应用程序被使用。如果主机是一个64位的过程中,AddInProcess.exe 是运行;否则,AddInProcess32.exe运行。要指定方式 可执行文件被选中,使用AddInProcess(平台)构造函数 创建AddInProcess对象。
可能需要针对为何出的进程加载项的主要原因的一些的应用程序是正确总结在Danielg的回答的之间进行选择。如果这些都其实并不适用于你的使用情况,您可以游览提供的解答和链接是MEF替代System.Addin ,以便判断,托管扩展框架(MEF)是否可能实际上是一个更好的解决方案 - 这是非常好的东西它做顺便说一句,很容易与编程,并广泛使用的相应
这篇关于给MAF插件,它作为单独的进程自定义名称运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!