0
votes

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=2.0.0.0, 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 () 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.

Here is an additional part of the error:

**=== Pre-bind state information === LOG: User = CORP\addison.sims LOG: DisplayName = System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL (Fully-specified) LOG: Appbase = file:///C:/Users/addison.sims/dev/CorpServices/Sites/CorpServices/trunk/webroot/CorpServices/ LOG: Initial PrivatePath = C:\Users\roger.smith\dev\CorpServices\Sites\CorpServices\trunk\webroot\CorpServices\bin

Calling assembly : (Unknown).

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\roger.smith\dev\CorpServices\Sites\CorpServices\trunk\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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL ERR: An assembly with different processor architecture is already loaded.**

2
have you tried adding it to the reference section in the project ? also check to see what the properties are for the assembly at the project level. if it looks at the bin folder you could get around this by setting the copy to local .. if deployed and it's looking to the bin folder first you need to add the assembly from the GAC and make sure that on the target machine that the path to the GAC'd assembly is the sameMethodMan
Are you sure that the DLL you've referenced and placed at the BIN folder is the correct version (2.0.0.0)?Andy Refuerzo
Thanks for the speedy reply. Yes, I have added references to System.Data.OracleClient to the project. I have also copied the assembly from the GAC to the bin. At this point I'm not sure where its the reference that is causing the conflict is defined. Heuser2012466

2 Answers

1
votes

In my experience, this is most likely caused by using the .NET "Client Profile" instead of the full framework. See this other question. Try downloading and installing the full framework.

1
votes

I had the same issue and it turned out Visual Studio was targeting the wrong .NET Framework. I changed it using the instructions here. The OracleClient I was trying to add is V4 and I was targeting .NET Framework 2. I changed to .NET 4 and it works fine now.