问题
I am looking for over 12 hours to find a proper solution for this particular problem... I have an ASP MVC (.NET framework 4.5) application that utilizes an Interbase XE database.
As long as I run it locally on my own machine, it works correctly. However, when I try to publish the site to my remote server, I get some assembly errors...
Could not load file or assembly 'Borland.Data.DbxCommonDriver, Version=16.0.0.0, Culture=neutral, PublicKeyToken=a91a7c5705831a4f' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Besides on looking on every possible solution posted on the internet (which did not help for me unfortunately). I also opened up the Borland.Data.DbxCommonDriver.dll in Reflector.
What amazes me there, is that Reflector states that the version I have (both local AND remote!!) has PublicKeyToken=91d62ebb5b0d1b1b instead of a91a7c5705831a4f, all other settings are equal (including the versionnumber 16.0.0.0).
So the next thing I did, was tracing down all possible .dll files on the servermachine. I uninstalled the ADO.NET 2.0 driver, and removed all existing occurrences of the dll's. As soon as the server was freed of any DLL's, I rebooted it and reinstalled the ADO.NET 2.0 for Interbase driver.
However, I instantly got the same assembly error. Now, I am a little bit exhausted of ideas...
- How can the error that is shown, show a different PublicKeyToken?
- Do I need to put things in the web.config file (to force a usuage of an assembly or such)?
- How can I determine where the erroneous PublicKeyToken is referenced from?
NOTES:
The servermachine is a 64-bit machine. This means that I have set the ApplicationPool to accept 32-bit applications, in order to support the ADO.NET 2.0 drivers from Embarcadero.
I have developed my web application with MS Visual Studio 2012 Pro.
Resources:
https://forums.embarcadero.com/message.jspa?messageID=528498 http://docs.embarcadero.com/products/interbase/IBXEUpdate5/Readme.html
回答1:
Finally after a few weeks, I have managed to solve this particular issue. It turned out to be a simple solution, as simple solutions are most often the hardest ones to find...
It turns out that Embarcadero RAD Studio has the Borland.Data.DbxCommonDriver.dll, Borland.Data.AdoDBXClient.dll and the Borland.Data.DBXInterBaseDriver.dll installed locally as well. These dll's have a different version number than the DLL's provided by the ADO.NET 2.0 drivers provided by Embarcadero. I tracked this down by performing a search in the Windows Registry. So if you are facing an equal problem, find out what drivers are registered in the registry to find their exact location...
After removing the references that pointed towards the ADO.NET 2.0 drivers (typically installed at C:\Embarcadero\Interbase_ADO.NET) and setting the references to the DLL's located at the Embarcadero RAD Studio installation folder, things were still working locally.
After publishing the site, it still did not work. So I removed every reference from the machine.config files and updated the web.config file for the webapplication. Finally, I deployed the files 'dbxconnections.ini' and 'dbxdrivers.ini' alongside my webapplication (which was stated in this Embarcadero knowledgebase article).
After cleaning the server, I did another publish of the webapplication and it works! It still is a pity however that there are so many different versions available of these Borland.Data.DbxXXX drivers, things might get tricky to really find out what is wrong.
Though I still doubt that there are not many programmers facing this particular issue, I still thought it might be handy to post my solution. I do hope it may help :)
回答2:
I am having the same issue ( you posted on my thread)
Maybe this cna be of help : http://docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4/EN/html/devcommon/deployingadodbxclient_xml.html
I am too novice to find the PublicKeytoken.. but maybe you can work it out for your project with this!
来源:https://stackoverflow.com/questions/21628601/ado-net-2-0-interbase-driver-and-asp-net-wrong-assembly-reference