addition — 2013-01-28T15:16:43-05:00 — #1
I am currently trying to debug an Asp.net 2.0 project with a c# code behind, without receiving errors, in Chrome through Visual Studio 2012. The solution was originally created in VS 2005 and upgraded/imported it into VS 2012. However, I am encountering this error when I attempt to run the solution:
Could not load file or assembly 'System.Data.OracleClient, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have added references to System.Data.OracleClient to each of the projects within the solution, but this has not resolved the issue. Additionally, I have checked the GAC (Global Assembly Cache) for a reference to the assembly (System.Data.OracleClient); it is present. I have also added a reference to the assembly (<add assembly="System.Data.OracleClient, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089" >) to the web.config file for version 2.0 of .Net (C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config). I noticed that the project seems to look for the dll in the bin folder of the solution, so I have copied the dll from the GAC to the bin. None of the above steps have resolved the issue. I continue to receive the same error message when the solution is debugged. Any answers or suggestions you could provide would be greatly appreciated. Thank you in advance.
cpradio — 2013-01-28T15:23:28-05:00 — #2
If it is looking in the bin/ you will want to set the Copy Local property to True by right clicking on the reference and changing the value. This way, if you build in debug or release mode, the DLL will get copied to the appropriate bin/ location.
However, since this is in the GAC, you shouldn't need to do this. I'd first uninstall the assembly from the GAC, and re-install it. Remove any project references and add it back where necessary (make sure Visual Studio is closed when you uninstall from the GAC and re-install to the GAC).
addition — 2013-01-29T11:19:47-05:00 — #3
Thank you for the timely response. So, I tried to uninstall the System.Data.OracleClient assembly, but I receive the message that I can not remove becaues it is used by the .Net framework.
cpradio — 2013-01-29T11:42:56-05:00 — #4
Did you perform an iisreset prior to attempting to removing the assembly? I find that occasionally there is a worker process still holding the assembly when I try and remove it.
Another option would be to try performing a repair on the .NET assembly or the OracleClient installation.
addition — 2013-01-29T13:03:15-05:00 — #5
I performed an iisreset before trying to remove the assembly and recieved the same message stating it is required by .net. How do I go about repairing the Oracle Client installation or .Net assembly. Thanks for the help.
cpradio — 2013-01-29T13:05:56-05:00 — #6
Add/Remove Programs or Programs and Features (for Windows Vista and after), then find the application, and right-click and choose repair.
addition — 2013-01-29T14:54:32-05:00 — #7
I repaired .net 2.0 framework sp2. No change in error. System.Data.OracleClient didnt show up in Programs and features. Thanks for your help
cpradio — 2013-01-29T15:00:08-05:00 — #8
After importing to VS 2012, what is the target framework for each project? You can find out by right clicking on the project and choosing properties (should be in the Application section).
addition — 2013-01-29T15:23:19-05:00 — #9
.Net Framework 2.0 is the target framework for each project.
cpradio — 2013-01-29T15:54:58-05:00 — #10
Boy I'm stumped. I've gone through my list of things. I've heard of some issues with VS 2012 and the installation of .NET 4.5 causing problems, but not specifically over the OracleClient. I also don't know of any resolutions at this point either...
addition — 2013-01-31T14:38:39-05:00 — #11
Thanks for all your help. I'll let you know if I find a solution.
wwb_99 — 2013-02-01T13:31:51-05:00 — #12
The key phrase in that error message is "or one of it's dependencies"; I'd turn on fusion logging and see what is happening under the surface -- sounds like a strange 2nd level dependency thing that will make a lot of sense once you figure out.
addition — 2013-02-01T16:03:04-05:00 — #13
Thanks, so I turned on fusion and I get this additional information about the error.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.OracleClient, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.
=== Pre-bind state information ===
LOG: User = CORP\addison.sims
LOG: DisplayName = System.Data.OracleClient, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
LOG: Appbase = file:///C:/Users/addison.sims/dev/CorpServices/Sites/CorpServices/trunk/webroot/CorpServices/
LOG: Initial PrivatePath = C:\Users\addison.sims\dev\CorpServices\Sites\CorpServices\ runk\webroot\CorpServices\bin
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\addison.sims\dev\CorpServices\Sites\CorpServices\ runk\webroot\CorpServices\web.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: System.Data.OracleClient, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
ERR: An assembly with different processor architecture is already loaded.
wwb_99 — 2013-02-01T16:22:39-05:00 — #14
Id try forcing the site to compile to x86 or x64 rather than anycpu and see what happens.
addition — 2013-02-01T16:32:01-05:00 — #15
Try to compile to x64 resulted in this error:
Could not load file or assembly 'CorpServices, Version=1.0.4780.29715, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
addition — 2013-02-01T16:33:57-05:00 — #16
Compiling to x86 resulted in the same Oracle Client error. Thanks for the suggestion.