locked
Oracle.DataAccess RRS feed

  • Question

  • User-1207209249 posted

    I am encountering an error with my Oracle.DataAccess reference. I was working at first on the server, but after further development, I tried to publish and recieved this error.

    I do not want to locally copy the dll in the bin folder, and I would prefer if the application can run on either CPU (even though I have tried publishing on x86 only).

    The server is setup correctly, because as I mentioned before I have a version of the published code (I do not have the source) which works on the server.

    What might be the problem?

    The error below:

    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\NETWORK SERVICE
    LOG: DisplayName = Oracle.DataAccess
     (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: Oracle.DataAccess | Domain ID: 19
    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:///E:/inetpub/wwwroot/SAAM/
    LOG: Initial PrivatePath = E:\inetpub\wwwroot\SAAM\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: E:\inetpub\wwwroot\SAAM\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/saam/27fd3199/21ab537d/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/saam/27fd3199/21ab537d/Oracle.DataAccess/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///E:/inetpub/wwwroot/SAAM/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) +11396867
       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) +11529072
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 <!-- [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. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) [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. at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at System.Web.Compilation.BuildManager.CallPreStartInitMethods() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) [HttpException]: 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. at System.Web.HttpRuntime.FirstRequestInit(HttpContext context) at System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

    Wednesday, June 20, 2012 10:07 AM

Answers

  • User269602965 posted

    essentially same error

    missing ODP.NET installation components as per last post from me and the other answer participant.

    You check the GAC yet?

    If you do not see Oracle.xxx folders,

    you are not making any headway.

    I do not understand why you will not put the correct version and bit of Oracle.DataAccess.dll into the application /BIN folder and make local reference.  It solves many problems.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 21, 2012 12:42 PM

All replies

  • User269602965 posted

    Have you verified Oracle Data Access component is installed in the GAC??

    C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess

    for the 32-bit ODP.NET Client installation.

    and does this correspond with what you reference in your app?

    and is this the same version in your 32-bit Oracle Client installation on the application server?

    {HOME_Client32}\ODP.NET\bin\4 folder

    Wednesday, June 20, 2012 4:21 PM
  • User-1207209249 posted

    I have partially solved the previous error, I have this one now:

     

     

    Server Error in '/SAAM' Application.


    Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

    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.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

    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, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' could not be loaded.

    === Pre-bind state information ===
    LOG: User = NT AUTHORITY\NETWORK SERVICE
    LOG: DisplayName = Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
     (Fully-specified)
    LOG: Appbase = file:///E:/inetpub/wwwroot/SAAM/
    LOG: Initial PrivatePath = E:\inetpub\wwwroot\SAAM\bin
    Calling assembly : DatabaseConnection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: E:\inetpub\wwwroot\SAAM\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: Publisher policy file is found at C:\Windows\Microsoft.Net\assembly\GAC_64\Policy.4.112.Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342\Policy.4.112.Oracle.DataAccess.config.
    LOG: Publisher policy file redirect is found: 4.112.3.0 redirected to 4.112.3.0.
    LOG: Post-policy reference: Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
    LOG: The same bind was seen before, and was failed with hr = 0x80070002.
    


    Stack Trace:

    [FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.]
       DatabaseConnection.DatabaseAdapter..cctor() in C:\Documents and Settings\rsammut\My Documents\FCR\WP0001\Sources\DatabaseConnection\DatabaseAdapter.cs:24
    
    [TypeInitializationException: The type initializer for 'DatabaseConnection.DatabaseAdapter' threw an exception.]
       DatabaseConnection.DatabaseAdapter.GetInstance() in C:\Documents and Settings\username\My Documents\FCR\WP0001\Sources\DatabaseConnection\DatabaseAdapter.cs:60
       SAA.Database_Layer.DB_ExceptionLog.GetAuditIdNextVal() in C:\Documents and Settings\username\My Documents\Visual Studio 2010\Projects\SAA\SAA\Database Layer\DB_ExceptionLog.cs:22
       SAA.Business_Layer.SaaUtilities.GetExceptionIdNextVal() in C:\Documents and Settings\username\My Documents\Visual Studio 2010\Projects\SAA\SAA\Business Layer\SaaUtilities.cs:17
       SAA._Default.Page_Load(Object sender, EventArgs eA) in C:\Documents and Settings\username\My Documents\Visual Studio 2010\Projects\SAA\SAA\Default.aspx.cs:56
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 <!-- [FileNotFoundException]: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. at DatabaseConnection.DatabaseAdapter..cctor() [TypeInitializationException]: The type initializer for 'DatabaseConnection.DatabaseAdapter' threw an exception. at DatabaseConnection.DatabaseAdapter.GetInstance() at SAA.Database_Layer.DB_ExceptionLog.GetAuditIdNextVal() in C:\Documents and Settings\rsammut\My Documents\Visual Studio 2010\Projects\SAA\SAA\Database Layer\DB_ExceptionLog.cs:line 22 at SAA.Business_Layer.SaaUtilities.GetExceptionIdNextVal() in C:\Documents and Settings\rsammut\My Documents\Visual Studio 2010\Projects\SAA\SAA\Business Layer\SaaUtilities.cs:line 17 at SAA._Default.Page_Load(Object sender, EventArgs eA) in C:\Documents and Settings\rsammut\My Documents\Visual Studio 2010\Projects\SAA\SAA\Default.aspx.cs:line 56 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\saam\27fd3199\21ab537d\App_Web_5an1jifb.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

    Thursday, June 21, 2012 3:10 AM
  • User143067745 posted

    It seems that you haven't install ODP.NET. Download It and install from here: ODAC Oracle Provider

    http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html

    Thursday, June 21, 2012 5:33 AM
  • User269602965 posted

    essentially same error

    missing ODP.NET installation components as per last post from me and the other answer participant.

    You check the GAC yet?

    If you do not see Oracle.xxx folders,

    you are not making any headway.

    I do not understand why you will not put the correct version and bit of Oracle.DataAccess.dll into the application /BIN folder and make local reference.  It solves many problems.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 21, 2012 12:42 PM