Hi,
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
Kindly help me.
Regards,
Pratik
Hi,
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
Kindly help me.
Regards,
Pratik
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Dec 11, 2023, 3:41 PM
do refere below links
https://stackoverflow.com/questions/15596834/could-not-load-file-or-assembly-oracle-dataaccess-or-one-of-its-dependencies
https://stackoverflow.com/questions/15293975/could-not-load-file-or-assembly-oracle-dataaccess-error
Vishal JoshiPosted Dec 11, 2023, 6:52 AM
Try Adding a tag to your application web.config.
Thanks
Sam HobbsPosted Dec 8, 2023, 8:34 PM
You do not say what type of DLL you are trying to use, whether managed or unmanaged. You do not say if your application is managed or unmanaged.
I assume you are using C#, therefore your applicaiton is managed. I think but I am not sure that the error message you are getting is the result of attempting to use an unmanaged DLL. You can do that but it is better to use a managed DLL when available. To use an unmanaged DLL I think you need to register it as in:
Installation Guide
https://docs.oracle.com/en/industries/health-sciences/inform/7.0/install/index.html?toc.htm?226725.htm
However see the following for Nuget packages with managed libraries.
Oracle .NET, Visual Studio, and VS Code ODAC Downloads for Oracle Database
https://www.oracle.com/database/technologies/net-downloads.html
Jayraj ChhayaPosted Dec 8, 2023, 10:00 AM
Hello Pratik,
When encountering a "Could not load file or assembly" error in ASP.NET, it typically indicates a problem with the referenced assembly or one of its dependencies. In this case, the error is specifically related to the Oracle.DataAccess assembly.
To troubleshoot this issue, you can follow these steps:
Verify the Oracle.DataAccess assembly: Ensure that the Oracle.DataAccess assembly is present in the correct location and it is the correct version for your application. You may need to reinstall or update the Oracle.DataAccess assembly if it is missing or outdated.
Check the dependencies: The error message suggests that one of the dependencies of the Oracle.DataAccess assembly may be causing the issue. Use a tool like Dependency Walker to analyze the dependencies of the Oracle.DataAccess assembly and ensure that all required dependencies are present and correctly configured.
Check the application's target platform: The "incorrect format" error can occur if the application is targeting the wrong platform (e.g., 32-bit vs. 64-bit). Ensure that the application's target platform matches the platform of the Oracle.DataAccess assembly and its dependencies.
Check the application pool settings: If you are hosting your ASP.NET application in IIS, ensure that the application pool is configured correctly. Set the "Enable 32-Bit Applications" option to the appropriate value based on the platform of the Oracle.DataAccess assembly and its dependencies.
Check the machine.config file: The machine. config file located in the .NET Framework installation directory can sometimes contain conflicting assembly binding settings. Review the machine.config file and remove any conflicting settings related to the Oracle.DataAccess assembly.
By following these troubleshooting steps, you should be able to resolve the "Could not load file or assembly" error related to the Oracle.DataAccess assembly in your ASP.NET application.
Jignesh KumarPosted Dec 8, 2023, 5:48 AM
Hello Pratik,
Please check oracle data provider reference, step need to check to resolve this issue.