Page 1 of 1
Unable to load KMotion_dotNet Libraries error
Posted: Thu Jul 06, 2023 9:54 am
by gui_marchioro
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
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jul 06, 2023 2:42 pm
by TomKerekes
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.
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jul 06, 2023 5:01 pm
by gui_marchioro
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
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jul 06, 2023 5:13 pm
by TomKerekes
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.
Re: Unable to load KMotion_dotNet Libraries error
Posted: Fri Jul 07, 2023 1:56 am
by gui_marchioro
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
Re: Unable to load KMotion_dotNet Libraries error
Posted: Fri Jul 07, 2023 5:26 pm
by TomKerekes
Hi Guilherme,
The .exe of the example you are trying to run. For the example SimpleFormsCS it would be SimpleFormsCS.exe
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jan 11, 2024 8:32 pm
by Moray
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).
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jan 11, 2024 8:49 pm
by TomKerekes
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.
Re: Unable to load KMotion_dotNet Libraries error
Posted: Thu Jan 11, 2024 8:56 pm
by Moray
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.