问题描述
我正在尝试实现一个用 C# 编写的out of proc"COM 服务器.我该怎么做?
I am trying to implement an "out of proc" COM server written in C#. How do I do this?
我需要 C# 代码从我的主 C++ 应用程序中脱离 proc",因为我无法将 .NET 运行时加载到我的主进程空间中
I need the C# code to be "out of proc" from my main C++ application, because I cannot load the .NET runtime into my main process space
为什么?
我的 C++ 代码位于加载到许多不同客户 EXE 中的 DLL 中,其中一些使用不同版本的 .NET 运行时.由于只能将一个运行时加载到单个进程中,因此我最好的选择似乎是将我的 C# 代码放入另一个进程中.
WHY?:
My C++ code is in a DLL that is loaded into many different customer EXE's, some of which use different versions of the .NET runtime. Since there can only be one runtime loaded into a single process, my best bet seems to be to put my C# code into another process.
推荐答案
您可以使用 System.EnterpriseServices.ServicedComponent 创建 COM+ 组件.因此,您将能够创建进程外和进程内(客户端)组件激活以及池、远程处理、作为 Windows 服务运行等的所有 COM+ 优势.
You can create COM+ components using System.EnterpriseServices.ServicedComponent. Consequently, you'll be able to create out-of-proc and in-proc (client) component activation as well as all COM+ benefits of pooling, remoting, run as a windows service etc.
这篇关于我需要做什么来实现“out of proc"?C#中的COM服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!