I have created a website project on .net framework 4.0 in Visual Studio 2010 . But I am unable to add reference the Oracle.DataAccess dll. It is continously throwing the error " unable to load assembly Oracle.DataAccess . The system cannot find the file specified. "
But when I tried adding the reference in a web application project , it gets added. But when run the project it is throwing the same error. On the web page the error thrown is this :
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 'Oracle.DataAccess' could not be loaded.
=== Pre-bind state information ===
LOG: User =***********
LOG: DisplayName = Oracle.DataAccess
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Oracle.DataAccess | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
[BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess' 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.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
Any help on this , please.. I have been trying all sorts of things and nothing seems to workl.
BadImageFormatException occurs when you have a bit mismatch.
1) What is the TargetCPU set to when you compiled?
2) Are you running the app on 32 bit or 64 bit OS?
3) Confirm whether the app is running as 32 bit or 64 bit in the problem environment (open task manager, click the process tab, is there a *32 next to the name?)
4) Did you install 32 bit Oracle client or 64 bit Oracle client?
Hi Greg ,
1.The target CPU is set to Any CPU
2.Its a 64bit OS
3. I am running the App directly from Visual studio in debug mode.
4.I have both 32 bit and 64 bit versions of the oracle client and have tried adding reference to both versions of the odp.net dll