"Cannot find assembly" error in VS 2008

316 Views Asked by At

I had a web service on a 32-bit WIndows 2003 server that accessed Oracle database. It was built and converted to DLL with no issues. Then I had to port this to Windows 2012 64-bit server and I keep getting

Could Not Load File Or Assembly 'Oracle.DataAccess' Or One Of Its Dependencies.

I downloaded and installed 64 bit ODAC, but the problem remained. It was suggested to install the 32 bit version as well and I did that, so now I have two directories in C, C:\Oracle\Products\11.2.0\client_1 and client_2, one for 64-bit and one for 32-bit. GAC also contains both x86 and AMD64 versions of Oracle.DataAccess and Oracle.Web. I still get the same error.

Looking closely, I found that when I close the error window in VS 2008, there is an output window that shows

Warning: Unable to update auto-refresh reference 'oracle.dataaccess.dll'. Cannot find assembly 'C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342\oracle.dataaccess.dll'.

I checked and this folder is empty but there is a newer folder C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.**3**.0__89b483f429c47342 with oracle.dataaccess.dll in it.

How can I resolve this issue? I don't know how to make the reference to v4.0_4.112.3.0__89b483f429c47342 folder instead of v4.0_4.112.2.0__89b483f429c47342 folder, if this is the cause of the problem.

1

There are 1 best solutions below

0
On

I had a copy of DataAccess.DLL in BIN folder. I removed it and all is well.