views:

1366

answers:

2

I am using a COM DLL, a function call which returns an ADO RecordSet object and want to refer to it in my C# application.

Have added the reference, put the msado15,interop.adodb dll in the bin directory and debug directory, added assembly key in web.config but still get the following error:

The type 'ADODB.Recordset' is defined in an assembly that is not referenced. You must add a reference to assembly 'ADODB, Version=7.0.3300.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'.

Any ideas on what is the right way to do this?

Edit:Which assembly do I add to GAC? Where can i find the ADODB.dll?

Added the reference to c:\program files\microsoft.net\primary interop assemlies\adodb.dll and got it working finally

A: 

The assembly should be in GAC as the name suggests (the name has publickeytoken in it).

EDIT: The interop assembly for which the error is raised should be in GAC. OR remove the reference from your project and add the reference to the dll from the bin dir.

shahkalpesh
+1  A: 

Try changing your reference to ADODB.dll in your project to 'Copy Local' true.

Tomalak