Using DLL in NAV 2017 - Run on client - "true" works fine - but run on client "false" fails

NorthwNorthw Member Posts: 5
Hi,
I have written a DLL and installed it in the add-on folders on both my server and my client.
When i try to use the DLL in a codeunit it works fine as long as i define the - run on client property to "true". - but then ofcourse i can't use "with events".
When i set the - "run on client" to false i get an "object reference not set to an instance of an object" error when i try to run my codeunit.

Can anyone explain this difference in behavior when running clientside vs. serverside and have any idea what i can do to be able to run my codeunit with the dotnet variable running server side?

Answers

  • JuhlJuhl Member Posts: 724
    There is really no question. Either it runs on client or on server.

    Example if your dll creates a file on C: guess where it ends up in either case.
    Follow me on my blog juhl.blog
  • NorthwNorthw Member Posts: 5
    Thank you for your answere. But i think you misunderstand my question here. My DLL is not creating any file. My question is about difference in behavior when i tell the DOTNET variable to run either clientside or serverside.
  • JuhlJuhl Member Posts: 724
    It’s just and example. It doesn’t change the answer. It can do anything, but the setting deside where it does it.
    Follow me on my blog juhl.blog
  • NorthwNorthw Member Posts: 5
    I am aware of what the property does. That is not the issue. The problem i have is the when i have it client side it works fine. But when i run it server side i am unable to initiate run the methodes in the DLL. It tells me that the variable has not been initiated.
  • xStepaxStepa Member Posts: 106
    is your DLL compiled also as x64?
    Regards
    xStepa
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    The problem may be that if you run it on the client, the client knows where the dll is (because it downloads it) and is able to tell the OS during the initialisation where (in which file) the code base is.

    Try to register your dll on the NST server, or add it to the global assembly cache.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.