KMotion_dotNet.dll not found

Moderators: TomKerekes, dynomotion

Post Reply
TrayJohnson
Posts: 3
Joined: Tue May 07, 2024 4:05 pm

KMotion_dotNet.dll not found

Post by TrayJohnson » Tue May 07, 2024 4:19 pm

Greetings. I need your help. I wrote C# windows forms application, and it works fine on PC with Windows 10 and Visual Studio 2022. Now I copied entire Kmotion 5.0.7 folder (where my project is also located) and pasted it on laptop which also has Windows 10 and Visual Studio 2022. Now when I try to

Code: Select all

 _Controller = new KMotion_dotNet.KM_Controller();
I have an exception

Code: Select all

KMotion_dotNet.DMException: 'Dll Not Found Exception thrown :  Caller - [KMotion_dotNet.KM_Controller] :: Member - [KM_Controller]'
. In details of my exception I see:

Code: Select all

InnerException	{"Unable to load DLL 'KMotion_dotNet_Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}	System.Exception {System.DllNotFoundException}    
In solution explorer -> References, the path to Kmotion_dotNet seems correct. (the reference is set to KMotion5.0.7\KMotion\Debug and on PC it works fine. When I tried to add reference to KMotion_dotNet_Interop.dll it said reference could not be added. Tried the same on PC and it also said it could not be added, yet on PC all works fine. Can you give me an advice??

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: KMotion_dotNet.dll not found

Post by TomKerekes » Tue May 07, 2024 5:23 pm

Hi Tray,

Maybe the required version of .NET is missing on the PC? Does the example SimpleFormsCS run?

You might read this Thread.
Regards,

Tom Kerekes
Dynomotion, Inc.

TrayJohnson
Posts: 3
Joined: Tue May 07, 2024 4:05 pm

Re: KMotion_dotNet.dll not found

Post by TrayJohnson » Tue May 07, 2024 7:41 pm

It seems that I am unable to launch SimpleFormsCS as well, the same error. I try it on Visual Studio 2022 17.9.6. When I first open solution of the example you provided, namely SimpleFormsCS, it asks me to migrate to newer version of visual studio something like that, and then gives me the migration report. In properties it says the target framework is .NET Framework 4.8. As I now remember, on PC I had the same problems, when I tried to add reference to Kmotion_dotNet.dll on newly created projects, but on my PC SimpleFormsCS worked (on laptop even SimpleFormsCS doesn't work), so I basically remade your example project from the scratch. And now when I copy the same project to my laptop, it again has this error. I will try things recommended on the thread you linked me. If you have more recommendations for me based on information I provided you above, I would greatly appriciate it.
Attachments
зображення_2024-05-07_223402746.png

TrayJohnson
Posts: 3
Joined: Tue May 07, 2024 4:05 pm

Re: KMotion_dotNet.dll not found

Post by TrayJohnson » Wed May 08, 2024 11:02 am

Okay, after rebuilding the libraries with BuildAllLabs.sln, and for now, my projects seems to be working fine on laptop. I guess I should have tried to do that before writing on forum, I got confused because on my PC I did manage to make it all work without rebuilding, so I didn't know rebuilding was necessary. Anyway, thanks for the help. I will ask more questions if some problems occur later.

P.S. Is there some documentation regarding using KMotion_dotNet.dll in C# like what functions are there and how are they used ? I only saw examples which is fine, but I think it may be useful to have some documentation as well.

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: KMotion_dotNet.dll not found

Post by TomKerekes » Wed May 08, 2024 7:50 pm

Hi Tray,

The .NET documentation is on-line here.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply