简体   繁体   中英

Installation problem with C# application

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 my 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.

我发现了以下问题: 答案请检查第一个答案可能是由于我在第二台PC而不是.NET4 Full框架上安装了.NET4客户端配置文件导致的此问题

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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