[英].NET 4.0 Reference to wrong Oracle.DataAccess.dll
When I use my CruiseControl.NET Build Server to build my C# application it always references to the wrong Oracle.DataAccess.dll. 当我使用CruiseControl.NET Build Server构建C#应用程序时,它总是引用错误的Oracle.DataAccess.dll。 On my local machine it is working without any problems. 在我的本地计算机上,它可以正常工作。
My local machine and my build server are both Windows 7 machines. 我的本地计算机和构建服务器都是Windows 7计算机。 I installed the Oracle Client 11.2.0.3 (32 AND 64 bit) on both machines. 我在两台计算机上都安装了Oracle Client 11.2.0.3(32和64位)。 My application is a .NET Framework 4.0 C# application. 我的应用程序是.NET Framework 4.0 C#应用程序。 I set specific version and local copy of the OracleDataAccess.dll to false. 我将OracleDataAccess.dll的特定版本和本地副本设置为false。
When I build it on my local machine everything works fine. 当我在本地计算机上构建它时,一切正常。 I analyzed the file using IL-Disassembler, the reference here is ok: 我使用IL-Disassembler分析了文件,这里的引用是可以的:
.assembly extern Oracle.DataAccess
{
.publickeytoken = (89 B4 83 F4 29 C4 73 42 ) // ....).sB
.ver 4:112:3:0
}
When I build it on the build server my application references to the wrong OracleDataAccess.dll. 在构建服务器上构建它时,我的应用程序引用了错误的OracleDataAccess.dll。 Here I get this reference: 在这里,我得到此参考:
.assembly extern Oracle.DataAccess
{
.publickeytoken = (89 B4 83 F4 29 C4 73 42 ) // ....).sB
.ver 2:112:3:0
}
All the references in the project point to the 4... version. 项目中的所有引用均指向4 ...版本。 I reinstalled the 32 and 64 bit oracle clients. 我重新安装了32位和64位oracle客户端。 I checked all the oracle references on the build server, everything looks fine. 我检查了构建服务器上的所有oracle参考,一切看起来都很好。 After trying to find the error the whole day I don't know how to continue. 尝试整天发现错误后,我不知道如何继续。 Please, can someone help me with this problem? 拜托,有人可以帮我解决这个问题吗?
In your *.csproj
edit your reference to ODP.NET like this: 在您的*.csproj
编辑对ODP.NET的引用,如下所示:
<Reference Include="Oracle.DataAccess">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
Attributes like Version=...
or processorArchitecture=...
are not required. 不需要诸如Version=...
或processorArchitecture=...
类的属性。 Your application will load the correct Oracle.DataAccess.dll
depending on selected architecture and target .NET framework (provided that it is installed properly) 您的应用程序将根据所选的体系结构和目标.NET框架(如果已正确安装)加载正确的Oracle.DataAccess.dll
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.