Using a "COM" class

O

Ot

Although I think I have developed a class library properly, maybe I
haven't. When I attempt to include a reference to that class library A
which appears in the IDE when I click the COM tab after selecting add
reference, I get an error:

<quote>
A reference to 'A' could not be added. Converting that type library to a
..NET assembly failed. Type library A was exported from a CLR assembly and
cannot be re-imported as a CLR assembly.
</quote>

I am at a loss to understand what it is trying to tell me. If the stuff in
the DLL created is CLR (isn't that Common Language Runtime?) then shouldn't
a second project be able to reference the DLL by including it as a
reference?
 
A

Armin Zingler

Ot said:
Although I think I have developed a class library properly, maybe
I haven't. When I attempt to include a reference to that class
library A which appears in the IDE when I click the COM tab after
selecting add reference, I get an error:

<quote>
A reference to 'A' could not be added. Converting that type library
to a .NET assembly failed. Type library A was exported from a CLR
assembly and cannot be re-imported as a CLR assembly.
</quote>

I am at a loss to understand what it is trying to tell me. If the
stuff in the DLL created is CLR (isn't that Common Language Runtime?)
then shouldn't a second project be able to reference the DLL by
including it as a reference?

It is not possible to use the COM wrapper of a .NET assembly in a .NET
project (please don't ask me why). Reference the assembly (*.dll) directly
(on the ".NET" folder in the add reference dialog).


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
O

Ot

Armin Zingler said:
It is not possible to use the COM wrapper of a .NET assembly in a .NET
project (please don't ask me why). Reference the assembly (*.dll) directly
(on the ".NET" folder in the add reference dialog).


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Forgive me if my questions are naive. I am somewhat new to this.

So the consumer/user of my class references the class by directly referring
to the DLL.

In the COM environment, when the consumed/used class changes (a new version
delivered) the consuming program will refer/use the changed module, right?
My program, in turn, references classes via COM that are developed in C++,
C, et al. When those programs change, I do nothing to my code.

Will the consumer/user of _my_ class experience this behavior? That is,
when I deliver a slicker version will they automatically reap the benefit?
Or must they recompile?
 
A

Armin Zingler

Ot said:
Forgive me if my questions are naive. I am somewhat new to this.

So the consumer/user of my class references the class by directly
referring to the DLL.

In the COM environment, when the consumed/used class changes (a
new version delivered) the consuming program will refer/use the
changed module, right? My program, in turn, references classes via
COM that are developed in C++, C, et al. When those programs change,
I do nothing to my code.

Will the consumer/user of _my_ class experience this behavior?
That is, when I deliver a slicker version will they automatically
reap the benefit? Or must they recompile?

Sorry, I have (almost) no experience in this.

Somebody else can help?

There is also an interop group:
microsoft.public.dotnet.framework.interop

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top