I have designed a C# application using Visual Studio 2010 with .NET framework 4.0 and it works well on my PC. I used an DLL to connect the Oracle DB. I created a Setup project for m开发者_StackOverflow社区y application to deploy it, when I tried to install the application on a second PC, it asked me to install the .NET Framework client, and I have installed it. After that when I tried to run my application it works but each time the code try to call a function from The DLL it throws an exception:
System.IO.FileLoadException: Could not load file or assembly 'System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies
I added the DLL to the setup file, but it didn't work. I have tried to add this code to my config file:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="System.Data.OracleClient" fullName="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblyBinding>
</runtime>
But it didn't work too. Any help, please.
I have found the following: Answer please check the first answer maybe this problem caused because I have installed the .NET4 Client Profile on the second PC not the .NET4 Full framework
If you are sure that the OracleClient-Dll is deployed on the second PC, then the problem is in the "or one of its dependencies" part.
At least when I used the Oracle client the last time (a few years ago) it required the installation of additional Oracle client Dlls from the Oracle installation CDs. That's because the .NET Dll was just a wrapper that called into the client Dlls deployed on the client PC.
BTW: Our solution at that time (because we didn't want our customers to install the Oracle client) was to buy the .NET Dll from DataDirect. They aren't cheap but they implement the complete data access in managed code, so you really need to just copy some Dlls into your application folder (or in the GAC if you want to).
精彩评论