Could not load file or assembly 'Devart.Data.Linq'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
dniehaushladilo
Posts: 5
Joined: Wed 02 Mar 2016 23:34

Could not load file or assembly 'Devart.Data.Linq'

Post by dniehaushladilo » Thu 03 Mar 2016 14:37

Hi,

We have two applications that currently use Devart 5.70.170 and looking to upgrade them to Devart 8.4.255.0.


We upgraded one of them and it works fine locally in localHost. When we push it to our deployment server which will have both applications (One upgraded, one not) and only Devart 5.70.170 is install we get the following error:

Code: Select all

Could not load file or assembly 'Devart.Data.Linq, Version=4.4.563.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) 
Are we able to install both versions of Devart on the deployment server? because when we try it trying to uninstall the older version of Devart. If not would the old version of Devart be able to run successfully with only the newer version of Devart installed? And if that doesn't work what would be the solution to have both versions running sucessfully on the deployment server?

Thanks,

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by MariiaI » Fri 04 Mar 2016 10:28

Are we able to install both versions of Devart on the deployment server?
Please refer to these forum threads:
http://forums.devart.com/viewtopic.php?f=3&t=33127
http://forums.devart.com/viewtopic.php?f=1&t=30249

Please tell us if this information helps.

dniehaushladilo
Posts: 5
Joined: Wed 02 Mar 2016 23:34

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by dniehaushladilo » Wed 09 Mar 2016 15:03

Hi,

We have preformed the following steps on our server:

1 – I removed the following registry key: Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Devart\Installed Products\dotConnect\Net2\Oracle]
"UninstallPath"="C:\\Program Files (x86)\\Devart\\dotConnect\\Oracle\\Uninstall\\unins000.exe"

2 – Uninstalled “policy.*.Devart.*” files from “%windir%\assembly” and “%systemdrive%\Windows\Assembly”

3 – The setup package dcoracle84pro.exe now only warns of “Incompatible version found”, “Devart.Data assembly version 5.0.143.0 is found in Global Assembly Cache. This product is compatible with Devart.Data.dll version 5.0.1017.0.” Continued installation.

4 – Installation folder “C:\Program Files (x86)\Devart\dotConnect\Oracle_8_4_225\”

5 – Minimal Installation chosen

6 – Start Menu “Devart dotConnect for Oracle 8.4.225”

Added assembly's to the web config:

Code: Select all

        <add assembly="Devart.Data.Oracle.Web, Version=8.4.225.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
        <add assembly="Devart.Data.Oracle, Version=8.4.225.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
        <add assembly="Devart.Data, Version=5.0.1017.0,  Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
        <add assembly="Devart.Data.Linq, Version=4.4.563.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>
And we are still getting the following errors:

Could not load file or assembly 'Devart.Data.Linq, Version=4.4.563.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)

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by Pinturiccio » Thu 10 Mar 2016 10:04

dniehaushladilo wrote:5 – Minimal Installation chose
When you perform minimal installation, the Devart.Data.Linq.dll assembly is not installed. You need to select minimal installation and then additionally select the following check boxes:
1. LINQ - to add the Devart.Data.Linq.dll assembly of version 4.4.563.0 to the GAC;
2. ASP.NET Web Providers - to add the Devart.Data.Oracle.Web assembly of version 8.4.225.0 to the GAC.

dniehaushladilo
Posts: 5
Joined: Wed 02 Mar 2016 23:34

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by dniehaushladilo » Mon 28 Mar 2016 15:51

Hi,

We have successfully got Devart 5.70.170 and Devart 8.4.255.0 on the deployment server and both applications are able to run. However we are experiencing a database connection issue. Our applications database connections are no longer releasing back to the pool properly compared to before the Devart 8.4.255.0 was installed.

We keep getting errors due to the max pool size was reached however this never happened before. In our connection strings we have a max pool size and connection lifetime.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by Pinturiccio » Tue 29 Mar 2016 16:07

If we understood you correctly, the described behavior occurs in an application, working with dotConnect for Oracle 5.70.170 assemblies? May be you have not deleted the policy files from the GAC after installing dotConnect for Oracle 8.4.225. You can debug your application and see which assemblies are loaded when it is running.

There were 4 years of development and bug fixes between versions 5.70.170 and 8.4.225. We cannot say what exactly can affect the behavior. Please make sure that your projects use the corresponding versions of Devart assemblies when running.

dniehaushladilo
Posts: 5
Joined: Wed 02 Mar 2016 23:34

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by dniehaushladilo » Tue 29 Mar 2016 16:30

Hi,

I will explain quickly.

We have one application on Devart 5.70.170 and another was upgrade to Devart 8.4.255.0. Our web deployment server has only Devart 5.70.170. It was noted that we can have both Devart 5.70.170 and Devart 8.4.255.0 installed on the same deployment server. We performed the following steps:

1. Run IISRESET to ensure any file locks are removed (recycling both app pools is also likely fine)
2. Uninstall all DevArt dotConnect for Oracle versions if any are installed (via Programs and Features control panel)
3. Manual review/cleanup any files left over in the folder “C:\Program Files (x86)\Devart\dotConnect\” (if they exist)
4. Manual review/cleanup any files left over in the GAC folder “C:\Windows\assembly\GAC_MSIL\” (examples below if necessary and files exist)
a. Open command prompt
b. cd \Windows\assembly\GAC_MSIL\
c. dir *devar*
d. rd Devart.Data /s /q
e. rd Devart.Data.Linq /s /q
f. rd Devart.Data.Linq.Web /s /q
g. rd Devart.Data.Oracle /s /q
h. rd Devart.Data.Oracle.Linq /s /q
i. rd Devart.Data.Oracle.Web /s /q
5. Install DevArt dotConnect for Oracle v5.70.190
a. Installation folder “C:\Program Files (x86)\Devart\dotConnect\Oracle_5_70_190\”
b. Minimal Installation chosen and then add LINQ, ASP.NET Web Providers and Support for ADO.NET Entity Framework
c. Start Menu “Devart dotConnect for Oracle v5.70.190”
d. After installation has finished rename folder “C:\Program Files (x86)\Devart\dotConnect\Linq\” to “C:\Program Files (x86)\Devart\dotConnect\Linq_5_70_190\”
6. Remove the following registry key
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Devart\Installed Products\dotConnect\Net2\Oracle]
"UninstallPath"="C:\\Program Files (x86)\\Devart\\dotConnect\\Oracle\\Uninstall\\unins000.exe"
7. Uninstall 13 “policy.*.Devart.*” files from “%windir%\assembly”
8. Install DevArt dotConnect for Oracle v8.4.225
a. The setup package dcoracle84pro.exe warns of “Incompatible version found”, “Devart.Data assembly version 5.0.143.0 is found in Global Assembly Cache. This product is compatible with Devart.Data.dll version 5.0.1017.0.” Continue installation.
b. Installation folder “C:\Program Files (x86)\Devart\dotConnect\Oracle_8_4_225\”
c. Minimal Installation chosen and then added LINQ, ASP.NET Web Providers and Support for ADO.NET Entity Framework
d. Start Menu “Devart dotConnect for Oracle v8.4.225”
e. After installation has finished rename folder “C:\Program Files (x86)\Devart\dotConnect\Linq\” to “C:\Program Files (x86)\Devart\dotConnect\Linq_8_4_225\”
9. Uninstall 2 “policy.1.0.Devart.*.Linq” files from “%windir%\assembly”
10. Run IISRESET to ensure that any old libraries are released so that any testing is valid (recycling both app pools is also likely fine)

It appears that both applications (one using 5.70.170 and the other using 8.4.255 are having troubles with the pooling not releasing.

Please let me know if we are missing something.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by Pinturiccio » Wed 30 Mar 2016 10:13

dniehaushladilo wrote:9. Uninstall 2 “policy.1.0.Devart.*.Linq” files from “%windir%\assembly”
Probably you have deleted the policy.1.0.Devart.Data.Linq and policy.1.0.Devart.Data.Oracle.Linq files. The GAC displays the assembly names alphabetically, and after these files there is a number of Microsoft policy files. However below there are many Devart policy files. When installing dotConnect for Oracle 8.4.255 with selected LINQ, ASP.NET Web Providers and Support for ADO.NET Entity Framework features, about a hundred of Devart policy files is placed to the GAC. All of them should be deleted.

Since you have deleted only 2 policy files, your application, compiled with dotConnect for Oracle 5.70.170 assemblies, uses dotConnect for Oracle 8.4.225 assemblies when it is running.
dniehaushladilo wrote:It appears that both applications (one using 5.70.170 and the other using 8.4.255 are having troubles with the pooling not releasing.
In fact, both of the applications use dotConnect for Oracle 8.4.225 assemblies.
dniehaushladilo wrote:Our applications database connections are no longer releasing back to the pool properly compared to before the Devart 8.4.255.0 was installed.
dotConnect for Oracle 8.4.225 was released a year and a half ago. Even if the issue is reproduced with this version, it is probably already fixed.

Please try installing the latest version of dotConnect for Oracle - 8.5.616 - on the development computer. You can download the trial version from our website https://www.devart.com/dotconnect/oracle/download.html . We have also answered you by email about the case if you have already installed dotConnect for Oracle Trial on the development computer.

Is the issue reproduced with the latest version? If yes, please try to find the place in your application when a connection is not returned to the pool when it is closed. Create a small test project that demonstrates this behavior and send it to us.

dniehaushladilo
Posts: 5
Joined: Wed 02 Mar 2016 23:34

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by dniehaushladilo » Wed 30 Mar 2016 19:49

Hi,

We have removed all Devart policy files (a further 96 entries in the GAC) results in the following error message with our application that is trying to use Devart DotConnect for Oracle 8.4.225.

Code: Select all

“[A]Devart.Data.Oracle.OracleConnection cannot be cast to [B]Devart.Data.Oracle.OracleConnection. Type A originates from 'Devart.Data.Oracle, Version=5.70.190.0, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\windows\assembly\GAC_MSIL\Devart.Data.Oracle\5.70.190.0__09af7300eec23701\Devart.Data.Oracle.dll'. Type B originates from 'Devart.Data.Oracle, Version=8.4.225.0, Culture=neutral, PublicKeyToken=09af7300eec23701' in the context 'Default' at location 'C:\windows\assembly\GAC_MSIL\Devart.Data.Oracle\8.4.225.0__09af7300eec23701\Devart.Data.Oracle.dll'.”
For this application this error does not pop up on the development computer.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Could not load file or assembly 'Devart.Data.Linq'

Post by Pinturiccio » Thu 31 Mar 2016 12:38

The reason of the issue is that dotConnect for Oracle adds records with its version to the machine.config and web.config files when the provider is installed.

Thus, when you installed dotConnect for Oracle 5.70.190, the corresponding records were added to the machine.config and global web.config files. For example, ASP.NET providers. In these records, version 5.70.190 is specified. When you installed dotConnect for Oracle 8.4.225, the same records were added to the machine.config and global web.config files, but this time with version 8.4.225 specified.

At the run of the application, the required records are searched in the web.config file of the application. Probably, you haven't specified these records, and as a result, the record are searched in the machine.config and web.config global files. Records with version 5.70.190 are found in the first place. That is why the application that works with version 5.70.190 operates normally, meanwhile the error you described appears in the application that works with version 8.4.225.

Try copying all records that contain word “Devart” and the version number 8.4.225 from the machine.config and web.config global files to the web.config file of your application.

If you application is executed under .NET Framework 4.0 or higher, the machine.config and web.config global files are located in the %windir%\Microsoft.NET\Framework\v4.0.30319\Config\ folder. If you application is executed under .NET Framework 2.0 or 3.5, you should copy data from the machine.config and web.config global files located in the C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\ folder.

Post Reply