问题描述
我已经按照教程做了一个C#的COM对象。
I have made a C# COM object by following the tutorial.http://www.codeproject.com/Articles/18939/C-Com
现在我想在C#中使用它。当我去补充参考\ \ COM myComObject它给我的错误。它说,该库从.NET程序集进口,不能添加。添加,而不是.NET程序集的引用。
Now I want to use this in C#. When I go to add reference \ com \ myComObject it gives me error. It says that the library was imported from a .NET assembly and cannot be added. Add a reference to the .NET assembly instead.
推荐答案
我觉得还是说这是一个COM可见的.NET程序集,你应该直接作为添加.NET程序集。净assenbly。您链接到的技术是怎么写的,可以从VB6引用一个.NET assemby。有没有必要添加为一个COM引用一个.NET项目,只是将它作为一个正常的.NET参考。
I think it is saying it is a com visible .net assembly and you should add the .net assembly directly as a .net assenbly. The technique you link to is how to write a .net assemby that can be referenced from VB6. There is no need to add this as a com reference to a .net project, just add it as a normal .net reference.
这篇关于我们可以使用COM对象在C#项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!