Loading dll not working in other environments

I am trying to load LiteDB via this command :
add-type -path “c:\programdata\UniversalAutomation\Repository\LiteDb.dll”
It works well when done manually in a powershell console (7 or 5.1)

But when I try to load the library in a script running in PSU automation, it fails and returns no error.
When running the script in the integrated environment it works …

I don’t understand what happens, plz help :wink:

PSU Service is running with the same user as when I test the command manually in a console

The integrated environment already has LiteDB loaded so that’s why that works.

I don’t see why you could load it otherwise. Try using Reflection directly to see if an error is returned there.


Thank you, forgot PSU was using it sorry :wink:
Then I found the problem, the LiteDB.dll file was the pb. I took the one from PSU instead and it is working now.
Sorry for that.