Can we use COM objects in C# project?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 16:11:56

问题


I have made a C# COM object by following the tutorial. http://www.codeproject.com/Articles/18939/C-Com

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.


回答1:


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.



来源:https://stackoverflow.com/questions/9394133/can-we-use-com-objects-in-c-sharp-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!