Using COM dll problem

  • Thread starter Thread starter Steven Blair
  • Start date Start date
S

Steven Blair

I have used COM dll's wuthin my C# apps and have had no problems.
I simply add a reference to the dll and C# does the rest.
When I tried this on several other dll's (all built the same way) I get
the following error:

A reference to 'assemblyname.exe' cou
ld not be added. This is not a valid assembly or COM component. Only
assemblies with extension 'dll' and COM components can be referenced.
Please make sure that the file is accessible, and that it is a valid
assembly or COM component.

The dll's are COM. I have tried using C++ and VB dll's.

Can anyone help with this problem?

Steven
 
Hi, Steven,

Is the com object resides in a dll file, or exe file...

The error message simply tells you that you are trying to reference a
com object in an exe file (try to find out where the com object you were
using is defined ) ...

HTH..
 
Thanks for the response.

It's always a dll I try to access and then I get this error.

Any more information that might help me?
 
For anyone interested.

This problem appears to be machine related. Several other PC's in the
office with VS2005 installed can use the COM dll's.
I eventually got the DLL to work by loading VS2003 and adding a
reference via this IDE, and then using the Interop file generated by
VS2003 in my VS2005 setup.
 

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

Back
Top