如何指定的AddIn程序的名字呢?名字、程序、AddIn

2023-09-04 00:54:57 作者:亮瞎我脸

我使用的是微软的AddIn框架加载的外接程序组件。我运行他们自己的过程,他们从服务中分离出来。事情我不喜欢它,每一个外接程序进程显示为AddInProcess32.exe在任务管理器。当使用进程隔离,如何才能重命名,显示在任务管理器,以便它是为用户提供更多descriptinve叫什么名字?

I am using the Microsoft AddIn Framework to load AddIn assemblies. I am running them in their own process as to separate them from the service. The thing I don't like it that every AddIn process shows up as AddInProcess32.exe in the task manager. When using process isolation, how can we rename the name that shows in the taskmanager so that it's more descriptinve for users?

推荐答案

不幸的是,你不能。

文件名该进程是在私有方法的 GetProcessName(平台平台)硬codeD 的被称为在 System.AddIn.Hosting.AddInProcess 类的构造函数。 而System.AddIn.Hosting.AddInProcess是一个密封类,因此不能被继承和方法不能被覆盖。

Filename for that process is hardcoded in private method GetProcessName(Platform platform) which is called in constructor of the System.AddIn.Hosting.AddInProcess class. And System.AddIn.Hosting.AddInProcess is a sealed class so it can't be inherited and that method can't be overriden.

为您加载自定义进程名的唯一方法是下降的想法有关使用System.AddIn框架,并创建自己的。

The only way to customize process name for your add-in is to decline idea about using System.AddIn framework and create your own.

下面是文章有关创建插件架构在C#中有很多例子了良好的列表:的创建在C#中的插件框架:资源

Here is a good list of articles about creating plugin architecture in c# with a lot of examples: Creating a plug-in framework in C#: Resources.