none
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

    Question

  • Hi,

    I have a vs2008 web application. it built fine and it was runing fine use visual studio development server, but when i use IIS web server, it gave me the following error:

    Server Error in '/Vendorapplication' Application.


    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 = IIS APPPOOL\Vendorapplication

    LOG: DisplayName = Oracle.DataAccess

    (Partial)

    LOG: Appbase = file:///C:/Vendorapplication/Vendorapplication/

    LOG: Initial PrivatePath = C:\Vendorapplication\Vendorapplication\bin

    Calling assembly : (Unknown).

    ===

    LOG: This bind starts in default load context.

    LOG: Using application configuration file: C:\Vendorapplication\Vendorapplication\web.config

    LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config

    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\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/v2.0.50727/Temporary ASP.NET Files/vendorapplication/8cc1d433/257b7ed7/Oracle.DataAccess.DLL.

    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/vendorapplication/8cc1d433/257b7ed7/Oracle.DataAccess/Oracle.DataAccess.DLL.

    LOG: Attempting download of new URL file:///C:/Vendorapplication/Vendorapplication/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.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0

       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416

       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166

       System.Reflection.Assembly.Load(String assemblyString) +35

       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

     

    [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) +11211672

       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388

       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232

       System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48

       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210

       System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +191

       System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +54

       System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +295

       System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +476

       System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +116

       System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +175

       System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +52

       System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +50

       System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +425

       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263

     


    Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

     

     

     

    • Moved by Jackie-Sun Monday, January 31, 2011 6:25 AM (From:ADO.NET Entity Framework and LINQ to Entities)
    Saturday, January 29, 2011 12:57 AM

All replies

  • Hello MengJia,

     

    Welcome to the MSDN Forum and thank you for posting here.

    Based on your description, I think you could post the thread in the Oracle Forum.

    Here is the link: http://forums.oracle.com/forums/ And here I will move it to the off-topic forum.

    Thanks for your understanding and support.

     

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 31, 2011 6:24 AM
  • There is nothing to do with oracle. please do not remove this post. The key point is it works using visual studio development server, it was not working using IIS 7 server(also on the same development server).
    Monday, January 31, 2011 6:05 PM