Can we use COM objects in C# project?

2019-05-17 09:00发布

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.

标签: c# com
1条回答
We Are One
2楼-- · 2019-05-17 09:19

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.

查看更多
登录 后发表回答