So, we just changed our app pool to 64 bit runtime, after that I got
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.
We definetely don't use Oracle and have no references to its libs. SO i suppose it is DO who uses it, but why?
Updated at 03.06.2010 12:34:52
4.3RC2
Updated at 03.06.2010 12:40:16
Most likely this happens because:
- There is indirect reference to it via Xtensive.Storage.All.dll -> Xtensive.Sql.All.dll -> -> Xtensive.Sql.Oracle.dll. CopyIndirectDependencies target from DataObjects.Net.targets ensures all indirect dependencies are copied to Bin folder, including this one - we intentionally implemented this to ensure all the providers are copied to Bin folder to enable application to run on any supported DB without any additional copying, etc.
- Thus 32-bit Oracle.DataAccess.dll is copied to Bin folder
- Finally, you have some code that leads to loading of all the assemblies into the application Domain (e.g. it enumerates them).
Try the following:
- Remove assembly from Bin folder
- If this won't help, enable Fusion Log to find out who is responsible for its loading.
Do u propose to remove this assembly from Bin every build?
Updated at 03.06.2010 12:42:39
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.
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 'Oracle.DataAccess' 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 'Oracle.DataAccess' could not be loaded.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = Oracle.DataAccess
(Partial)
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.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/Home/Docs/Visual Studio 2010/Projects/Platform/Werp.View/
LOG: Initial PrivatePath = D:\Home\Docs\Visual Studio 2010\Projects\Platform\Werp.View\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Home\Docs\Visual Studio 2010\Projects\Platform\Werp.View\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/web.tester/c622f5ee/11cf6380/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/web.tester/c622f5ee/11cf6380/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///D:/Home/Docs/Visual Studio 2010/Projects/Platform/Werp.View/bin/Oracle.DataAccess.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[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.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) +118
[ConfigurationErrorsException: 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.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11392147
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +127
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 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309
This thread was imported from our support forum. The original discussion may contain more detailed answer.
asked
Jun 03 '10 at 11:43
xumix
425●75●76●82
What version of DO do you have? This was happing to me with version 4.1 but not now (4.2 or 4.3RC2)