Hi everyone,
I am having trouble solving this issue and welcome any ideas.
(I am running NAV 2017 32-bit version - my DLL and all its dependencies are 32-bit.)
I have created a codeunit that uses a DLL - and everything works great on my machine. I have copied all of the necessary DLLs to customer's server and local Addin folders - and it does not work on their computer - I get an Error:
Can not load an ..... instance of the following .N E T Framework object ...
The DLL listed in this error is not the one I am using in the code directly but one of the dependencies - but it is also copied in all necessary locations.
Everything works great after I repeated the process on my coworker's computer - connected to the customer's server.
And, after some experimenting, I was able to make it work on the customer's computer as well. So what is the problem then? It only works when I run my codeunit from the Development Environment first.
The process to make it "work" on the customer's pc is:
- Launch NAV client (32-bit).
- Launch Development Environment
- Run my Codeunit from Development Environment -> the function called in OnRun executes correctly
- Run the same function from an action in NAV client -> function executes correctly
Without the third step, I always run into the "Cannot load an instance ..." error. After restarting the client application the error comes back.
So to sum things up:
- Everything works on my laptop from locally-hosted NAV server
- Everything works on my laptop from customer's NAV server
- Everything works on my coworker's pc from customer's NAV server
- Everything works on customer's pc - but only when first executed from Development Environment
I hope this is not too convoluted.
I am lost here. I am thinking it is some windows security related issue? I do not know that much about that though. I will be happy to try out any ideas you throw at me.
Answers
Yes, we tried to use the cashier account with their permissions and our account that had SUPER permission and AD sysadmin permissions. Both accounts had the same problem.
T.
We have more integrations to the different platforms (e-sign, pdf printer, debit card terminals...) that work well.
or is the DevEnv on the same NST as the client?
(when you run it from DevEnv, it opens on predefined NST)
if you mentioned same function - you mean the same code and variables or exactly pure function call?
xStepa
Kepty's colleague here.
The CU is not single-instance.
It is on the same NST client - the exact steps are:
- Launching the NAV client - 32bit
- Launching DevEnv
- Running the codeunit in DevEnv -> it runs in the already running client
- Using the Action in the client that runs the same codeunit
In both cases it's the same function - the action in the client is just simple codeunit.run().