Could not load file or assembly Devart.Data.Oracle
Posted: Mon 20 Jan 2014 10:22
The Devart assemblies in our windows service solution have been upgraded since those assemblies are also upgraded on the buildserver. Devart is installed there because of the licence.
4 devart dll's included in the windows service and upgraded are:
Devart.data.dll (from version 5.0.1.0 to 5.0.536.0)
Devart.data.oracle.dll (from version 5.20.33.0 to 7.2.77.0)
Devart.data.oracle.linq (from version 1.0.13.0 to 4.1.82.0)
Devart.data.oracle.linq (from version 1.0.13.0 to 4.1.82.0)
Everything works fine on our test machines, 32/64 bit machines and with Oracle 10/11.
We have deployed and now things start getting complicated at (pilot)customers sites since upgrading.
The first error we encountered is an InvalidCastException error:
Message : Unable to cast object of type 'Devart.Data.Oracle.OracleConnection' to type 'Devart.Data.Oracle.OracleConnection'.
Source : Devart.Data.Oracle.Linq
These customers appear to have Devart dll's in the GAC (Global Assembly Cache):
Devart.data.dll version 5.0.21.0
Devart.data.oracle version 5.35.62.0
Maybe a reference prefers GAC over what's in its own directory and ignores version numbers. At one site we've boldy asked to remove these Devart assemblies from the GAC.
It changed the error to a FileLoadException:
Message : Could not load file or assembly 'Devart.Data.Oracle, Version=5.35.62.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Deinstalling and reinstalling the webservice did not help.
The devart references in the referencing project have properties Copy Local ‘True’ and Specific Version ‘False’
What is still referencing this wrong dll version?
4 devart dll's included in the windows service and upgraded are:
Devart.data.dll (from version 5.0.1.0 to 5.0.536.0)
Devart.data.oracle.dll (from version 5.20.33.0 to 7.2.77.0)
Devart.data.oracle.linq (from version 1.0.13.0 to 4.1.82.0)
Devart.data.oracle.linq (from version 1.0.13.0 to 4.1.82.0)
Everything works fine on our test machines, 32/64 bit machines and with Oracle 10/11.
We have deployed and now things start getting complicated at (pilot)customers sites since upgrading.
The first error we encountered is an InvalidCastException error:
Message : Unable to cast object of type 'Devart.Data.Oracle.OracleConnection' to type 'Devart.Data.Oracle.OracleConnection'.
Source : Devart.Data.Oracle.Linq
These customers appear to have Devart dll's in the GAC (Global Assembly Cache):
Devart.data.dll version 5.0.21.0
Devart.data.oracle version 5.35.62.0
Maybe a reference prefers GAC over what's in its own directory and ignores version numbers. At one site we've boldy asked to remove these Devart assemblies from the GAC.
It changed the error to a FileLoadException:
Message : Could not load file or assembly 'Devart.Data.Oracle, Version=5.35.62.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Deinstalling and reinstalling the webservice did not help.
The devart references in the referencing project have properties Copy Local ‘True’ and Specific Version ‘False’
What is still referencing this wrong dll version?