简体   繁体   中英

Could not load file or assembly: System.Data.OracleClient

I am currently trying to debug an Asp.net 2.0 project with ac# 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. * *

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM