Unable to load KMotion_dotNet Libraries error

Moderators: TomKerekes, dynomotion

Post Reply
gui_marchioro
Posts: 59
Joined: Sun Aug 21, 2022 11:22 pm

Unable to load KMotion_dotNet Libraries error

Post by gui_marchioro » Thu Jul 06, 2023 9:54 am

Hello,

I am trying to run the PC VCS Examples but I get an error:
Unable to load KMotion_dotNet Libraries. Check Windows PATH or .exe location
Dll Not Found Exception thrown: Caller - [KMotion_dotNet.KM_Controller] :: Member - [KM_Controller]
I tryed to reload the dll reference to the project but it didn't solve the problem.

What could possibly be done to clear this error?

Sincerely,
Guilherme

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

Re: Unable to load KMotion_dotNet Libraries error

Post by TomKerekes » Thu Jul 06, 2023 2:42 pm

Hi Guilherme,

KMotion_dotNet.dll should be in the same folder as the .exe you are trying to run. If you’re running a Debug configuration you should rebuild the libraries with Debug configuration. Use BuildAllLibs.sln.
Regards,

Tom Kerekes
Dynomotion, Inc.

gui_marchioro
Posts: 59
Joined: Sun Aug 21, 2022 11:22 pm

Re: Unable to load KMotion_dotNet Libraries error

Post by gui_marchioro » Thu Jul 06, 2023 5:01 pm

Hi,

Yes, I had built the libraries for debug as stated here:
https://www.dynomotion.com/wiki/index.p ... plications

But still the error persisted occurring.

What truly solved was to add the directory <install dir>/KMotion/Release to the Path in the environment Windows variables.
https://www.computerhope.com/issues/ch000549.htm

Sincerely,
Guilherme

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

Re: Unable to load KMotion_dotNet Libraries error

Post by TomKerekes » Thu Jul 06, 2023 5:13 pm

Hi Guilherme,

That will work fine but you shouldn't need to do that. Did you check where your .exe was actually being placed? Sometimes when VS projects are upgraded for new Versions VS changes where the output is to be placed.
Regards,

Tom Kerekes
Dynomotion, Inc.

gui_marchioro
Posts: 59
Joined: Sun Aug 21, 2022 11:22 pm

Re: Unable to load KMotion_dotNet Libraries error

Post by gui_marchioro » Fri Jul 07, 2023 1:56 am

Hello Tom,

I was just trying to run the VCS code examples in debug. I am not sure about which .exe you are talking to.
I opened it in Visual Studio Community 2015.

Sincerely,
Guilherme

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

Re: Unable to load KMotion_dotNet Libraries error

Post by TomKerekes » Fri Jul 07, 2023 5:26 pm

Hi Guilherme,

The .exe of the example you are trying to run. For the example SimpleFormsCS it would be SimpleFormsCS.exe

OutputPath.png
Regards,

Tom Kerekes
Dynomotion, Inc.

Moray
Posts: 282
Joined: Thu Apr 26, 2018 10:16 pm

Re: Unable to load KMotion_dotNet Libraries error

Post by Moray » Thu Jan 11, 2024 8:32 pm

I've currently got the same issue, but before I go setting a PATH in Windows, is there anything else I can try?

My application is building with the relevant .NET dll being placed in the build directory, but when I try running the app, it fails to find the KMotion libs (same result whether I launch it via VS, or directly from the build directory).

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

Re: Unable to load KMotion_dotNet Libraries error

Post by TomKerekes » Thu Jan 11, 2024 8:49 pm

Hi Moray,

Not sure what you mean by build directory?

I think the simplest thing is to target your binary to be placed with all KMotion’s binaries.

I think there is an also Registry option to have an App look for dependencies in specific locations. I think it is APP_PATHS.
Regards,

Tom Kerekes
Dynomotion, Inc.

Moray
Posts: 282
Joined: Thu Apr 26, 2018 10:16 pm

Re: Unable to load KMotion_dotNet Libraries error

Post by Moray » Thu Jan 11, 2024 8:56 pm

I've moved the Release build directory, so my app can be contained within it's own directory within the main KMotion5.3.1 directory (i.e. c:/KMotion5.3.1/KMoCNC/), just so everything is more contained.

If I set the build directory to the main KMotion/Release directory, everything works as it should, which I'll use for just now.

Post Reply