3

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.

2
  • 3
    If it is not an exercise, you would better use the C# object as is in the other c# project, avoiding the COM layer at all. Commented Feb 22, 2012 at 11:46
  • yes. I added dll file in reference instead of adding COM object reference. Commented Feb 22, 2012 at 12:33

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

yes. I added dll file in reference instead of adding COM object reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.