Oracle ODAC error setting up website in IIS: type A cannot be cast to type B?

774 views Asked by At

I have a website that I've developed in VS2010 with cassini. It's gone to production aleady and now I'm doing IE9 upgrades but when I load it into my local IIS (so I can hit it from a VM) I get this:

problem getting database connection: [A]Oracle.DataAccess.Client.OracleConnection cannot be cast to [B]Oracle.DataAccess.Client.OracleConnection. Type A originates from 'Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342\Oracle.DataAccess.dll'. Type B originates from 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' in the context 'Default' at location 'C:\Windows\assembly\GAC_32\Oracle.DataAccess\2.112.2.0__89b483f429c47342\Oracle.DataAccess.dll'. at DbLib.MyDatabase.getConnection()

Any clue what this is or how to get around it?

1

There are 1 answers

0
Garrison Neely On

Looks like an old version of the data access DLL is installed in the GAC. Does the DLL in c:\windows\microsoft.net... exist? If not, you may have to provide a copy of it in a bin folder and update your config to use the DLL in the bin. This assumes you want to use the new version and not the old one in the GAC.