LibPLCTag.NET Unable to find dll issue

674 views
Skip to first unread message

Richard Green

unread,
Oct 22, 2021, 4:42:34 AM10/22/21
to libplctag
Hi All, 

I've just recently resumed work on PLCs and I'm using the brilliant .net wrapper, I compiled in Visual Studio and pushed my solution out to two VMs, both on 64 bit Windows 10. One works fine, the other gives error unable to load DLL 'plctag' or one of its dependencies.

Has anybody had this and can give any pointers to which things I should be checking on the VM which fails? 


tim...@gmail.com

unread,
Oct 22, 2021, 11:22:35 PM10/22/21
to libplctag
Hi Richard,

Assuming you're using this package (https://github.com/libplctag/libplctag.NET) - get familiar with the interop between the .NET wrapper and the core library works - read this: https://github.com/libplctag/libplctag.NET#libplctagnativeimport

As long as you aren't seeing any other errors, it seems something is deleting plctag.dll after extraction - antivirus maybe?

Tim

Richard Green

unread,
Oct 29, 2021, 6:34:09 AM10/29/21
to libplctag
Hi Tim
Thanks for your reply and sorry for taking so long to get back to you
I got a screenshot here, I've used Task Manager, right click on the running process and chosen 'Open File Location' to get at the files for the running process.

libplctag.PNG

The VM on the left is the good one and the one on the right is the critical one
What's interesting is that plctag.dll has a modified date of 'just now' in both cases
Yet one works like a charm and the other gives up this error when I try to read a PLC:

libplctag2.PNG

I know this isn't a code fix so I'm not expecting that you or others will know the answer but I'm detailing the steps I've taken for if anybody has the same issue or if anyone can suggest other things for me to check

I'm running on Windows Ten VMs with .Net Core published using ClickOnce

Thanks again

jsla...@gmail.com

unread,
May 26, 2022, 10:38:20 AM5/26/22
to libplctag
Richard, were you able to find a solution to this problem?  I have 10 rugged tablets running Windows 10.  Seven of them work fine, three of them throw the error:

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

   at LibplctagWrapper.Libplctag.plc_tag_create(String lpString, Int32 timeout)

   at LibplctagWrapper.Libplctag.AddTag(Tag tag)

   at VehicleMountTerminalInventoryControl.Model.UnitizerTag.CreatePalletIdTag(Tag& tag)

   at VehicleMountTerminalInventoryControl.Controllers.LandTechUnitizerController.WritePalletid(Int32 palletId)

   at VehicleMountTerminalInventoryControl.frmMain.ScanHandler(String barcode)


I'm at a loss for why three fail while all the other work.  Hard to believe it's a dependency issue within the installer issue at this point.

Just looking for some thoughts.

Jim

Fernando Martinez

unread,
Jul 11, 2023, 1:42:49 AM7/11/23
to libplctag
Hi Sirs,

this is my problem please do you have any idea how to solve this problem? (System.DllNotFoundException: 'Unable to load DLL 'plctag': The specified module could not be found. (Exception from HRESULT: ), I already pasted the manual library in the debug folder but it didn't work.


please help.
problem lip.PNG
Reply all
Reply to author
Forward
0 new messages