[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can't load System.Data.OracleClient

Posted on 2011-10-22
8
Medium Priority
?
1,867 Views
Last Modified: 2013-11-05
I'm installing an ASP.NET application under Windows 2008 R2 that installs in Server 2003 with no problems. This is what I get in Server 2008 R2 when I try to access the application after installation (below)

I checked the code, and removed any lingering references to OracleClient. There aren't any left in code, no references and none in Web.Config. I also cleaned up the .NET cache for 2.0 and 4.0. Still, I get the message below when I try to use the application.


Server Error in '/ip' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.OracleClient' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Stack Trace:


[BadImageFormatException: Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123

[ConfigurationErrorsException: Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11479520
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1087

[HttpException (0x80004005): Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11612256
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4842149

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
0
Comment
Question by:gbaren
  • 4
  • 3
8 Comments
 
LVL 2

Expert Comment

by:yatin_81
ID: 37011736
The error may occur because some of the components of the website are designed to be run on 32-bit systems only(mainly dll files). Try to test and get it working on 64 bit machines as well.
0
 
LVL 5

Author Comment

by:gbaren
ID: 37011811
The application installs and works well under both 32 and 64 bit Server 2003. Besides, there are no references to System.Data.OracleClient. I don't understand why that message comes up at all.
0
 
LVL 10

Expert Comment

by:GlobaLevel
ID: 37019043
so what specific error do you get in regards to:
System.Data.OracleClient

this is used for coders to create applications that reference code objects to use and maintain an Oracle database in their code. Since your staging a box..I assum that the application cannot find the origial oracle database to pull and push data from this application...its looking for it
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:GlobaLevel
ID: 37019062
so it appears that you pulled this application and put it on a new box....but it cant run without access to a DB. I would get a DBA involved, this could get messy fast, also your messing with compiled code..so the DLL is still there..you need to go to the solution explorer right clik and add references and delete the oracle DLL..but the app still wont run as now it doent have a data source..i dont know without knowing more...
0
 
LVL 5

Author Comment

by:gbaren
ID: 37019149
1. I am the developer of this applicatgion. That is a person who wrote the stuff that tells the computer what to do.

2. It uses a database called SQL Server. It's made by Microsoft and uses a driver called System.Data.SQLClient

3. It does not use Oracle. That one is made by the Oracle Corporation and uses a driver called System.Data.OracleClient.

4. My question was why am I getting an OracleClient error when I'm not using OracleClient.

I appreciate your eagerness to answer my question foregoing a careful reading.

Thank you.

0
 
LVL 10

Expert Comment

by:GlobaLevel
ID: 37019739
Would this be of help, it seems like a similiar issue...
http://forums.asp.net/t/1207776.aspx/1
0
 
LVL 5

Accepted Solution

by:
gbaren earned 0 total points
ID: 37102665
The problem turned out to be the Oracle dll was left in the BIN folder. I cleaned out the references but inadvertantly left the file in there.

Neither of the above experts offered the solution.
0
 
LVL 5

Author Closing Comment

by:gbaren
ID: 37126839
Seems that I answered my own question. This service was better 10 years ago. What did you do with all the experts?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question