Can't run a windows form app on other PC, can't find a dll from a project of the same solution

0

(First things first, I'm kind of new on this type of programming) I'm trying to make a windows form application where i request data from a PLC so it can be stored in a access database. This application is going to be running on a different computer. On the solution i created and besides my project I'm using an existing project that works "like" the communication between the app and the PLC, it is called LibplctagWrapper (on my main project I create a reference to this last one) (https://www.mesta-automation.com/how-to-communicate-to-an-allen-bradley-plc-with-c-and-libplctag-ethernet-ip-library/), and it works on my PC, but every time y copy the Bin folder to the new computer, then run the app, it opens, but a warning popup messages appears. Saying: Unable to load DLL "plctag.dll": The specified module could not be found. (Exception from HRESULT: 0x8007007E).

The LibplctagWrapper is in another directory than my Solution and Main Project so I moved it to C: so the direction will be the same on the new computer. But it doesn't work.(copy the LibplctagWrapper in C: of the new pc as well)

Moved the entire solution/main project to C: as well... the same result.

Instead of just the bin folder i copied the entire project folder... im thinking the problem goes with the fact that the LibplctagWrapper is not in the same direction? but I don't know how to place it in the same direction... I search on visual studio but I never saw the option to move it.

Unable to load DLL "plctag.dll": The specified module could not be found. (Exception from HRESULT: 0x8007007E).

c#
.net
asked on Stack Overflow Jun 22, 2019 by Javier Mata

2 Answers

0

This error message is quite generic, missing dependencies can cause it as well as the mentioned module not being present at all. Check the Dependency Walker ( http://www.dependencywalker.com/) to discover required C++ runtimes or something alike. Remember to take x86/x64 into consideration.

answered on Stack Overflow Jun 22, 2019 by Dominik
0

@JavierMata - I think you have probably resolved this issue, but for others encountering something similar you can use the recently released official wrappers which can be downloaded via nuget. Github link: https://github.com/libplctag/libplctag.NET

The libplctag.NativeImport package handles loading the appropriate C runtime so you don't have to.

answered on Stack Overflow Sep 16, 2020 by timyha

User contributions licensed under CC BY-SA 3.0