我需要做什么来实现“out of proc"?C#中的COM服务器?

3

本文介绍了我需要做什么来实现“out of proc"?C#中的COM服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试实现一个用 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服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14