不能在 COM 客户端中添加引用 COM?

4

本文介绍了不能在 COM 客户端中添加引用 COM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

创建了一个 COM 服务器,我注册了它.

A COM server is create and I registerd that.

当我尝试在 COM 客户端中添加该 COM 服务器时,我无法添加,并且出现以下错误.

When I am trying to add that COM server in a COM Client, I was not able to add, and following error is comming.

" 不能引用 'COMTest'被添加

" A reference to 'COMTest' could not be added

ActiveX 类型库'cuser~DebugCOMTest.tlb' 是从 .NET 程序集导出并且可以不作为参考添加.

The ActiveX type Library 'cuser~DebugCOMTest.tlb' was exported from a .NET assembly and can not added as a reference.

改为添加对 .NET 的引用

Add a reference to .NET instead "

谁能告诉我是什么错误.我以两种方式注册了 COM,也从 VS 也尝试了命令提示符.

can anybody tell me What is the mistake. I register the COM in both way, from VS also and also tried with command prompt.

推荐答案

这是一个你为什么要这样做"的消息.项目+添加引用,浏览选项卡,选择DLL,而不是TLB.因此,您将直接使用 .NET 类,而不是通过 COM 互操作两次.

This is a "why on Earth would you do that" message. Project + Add Reference, Browse tab, select the DLL, not the TLB. So you'll use the .NET class(es) directly instead of going through the COM interop twice.

这篇关于不能在 COM 客户端中添加引用 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