简体   繁体   English

ODP Oracle.DataAccess使用.NETFramework 4.5,但不使用.NET Framework 4.0

[英]ODP Oracle.DataAccess was working with .NETFramework 4.5 but not with .NET Framework 4.0

In my application, i'm connecting to an Oracle DB via ODP. 在我的应用程序中,我正在通过ODP连接到Oracle DB。 I was using .NET 4.5 and everything was working fine but then for Windows XP compatibility i changed framework to .NET 4.0 on all the projects on my solution. 我使用的是.NET 4.5并且一切正常,但是为了与Windows XP兼容,我将解决方案上所有项目的框架都更改为.NET 4.0。 Application is built on .NET 4.0 succesfully but can not connect to DB via ODP and throws exception: 应用程序成功建立在.NET 4.0上,但无法通过ODP连接到DB并引发异常:

Could not load file or assembly 'Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I had created a References folder in Solution folder(near projects) and adding the Oracle.DataAccess.dll file as reference from there to the projects those use it. 我已经在解决方案文件夹(靠近项目)中创建了一个References文件夹,并将Oracle.DataAccess.dll文件作为参考从那里添加到使用它的项目中。 May it be the problem? 可能是问题吗?

在该解决方案的main( winforms )项目中,我将platform target从任何CPU更改为x86 ,现在它可以在.NET 4.0.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM