Wrong Result return RunOnClient = No

yukonyukon Posts: 357Member
According to MSDN we can define the dot net interpo is running at Client or Server side. But some of the case it working on Server Side but return result is taking from client information. I don't know what is the reason of this. Does anybody face this issue?

Make Simple & Easy


  • RockWithNAVRockWithNAV Posts: 798Member
    I used this property multiple ti,es but never faced this. Can you explain it more with the codes?
  • Slawek_GuzekSlawek_Guzek Posts: 1,647Member
    It might be due to lack of user process isolation.

    You don't know what is inside the particular .NET t interop - it might be using some shared memory, it might have static members. If it is the case you may two users having their own instances of .NET vars, but since they both run on the same NST process the internall .NET code might be manipulating internally the same aera of memory, so the data is leaking between users' processes.

    Not sure, just guessing.

    Long time ago when the RTC came to life and people were using in their code single instance codeunits they moaned that if they use the same code from a web service call the data inside single instance codeunit is not preserved between calls (which was just a lack of understanding that each web service call is a separate session). Someone came up with a trick exploiting static class members to build a .NET dll enabling to preserve the status/data between web calls - effectively sharing the data between sessions.

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • yukonyukon Posts: 357Member
    @Slawek_Guzek and @RockWithNAV

    Thanks for your reply and interesting on my question.

    Actually, i'm using single user to testing this case. Below is my test case

    OBJECT Codeunit 50000 DNetTest
    Time=[ 8:32:09 PM];
    Version List=;
    [email protected] : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity" RUNONCLIENT;
    [email protected] : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Principal.WindowsIdentity";
    [email protected] : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo" RUNONCLIENT;
    [email protected] : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Globalization.CultureInfo";
    MESSAGE('Client User %1\Server User %2',

    dnetCultureInfoRunOnClient := dnetCultureInfoRunOnClient.CurrentCulture;
    dnetCultureInfoRunOnServer := dnetCultureInfoRunOnServer.CurrentCulture;

    MESSAGE('Client Culture %1\Server Culture %2',



    You will get right result for Login user name but Culture result is wrong. Why wrong? Culture name is always same, even you set different region setting on server and client. By right should be different name if we set different region setting on Server and Client. "dnetCultureInfoRunOnServer" is running on server but name is taken from "Client Region Name".

    In order to test you need to set different Region Setting on Server and Client.

    I was posted on https://community.dynamics.com/nav/f/34/t/276917. One of active member reply that can be Threading. I not sure how Nav server handle the threading in between server and client.

    Make Simple & Easy
  • BlackTigerBlackTiger Posts: 1,207Member
    Impersonalization. User session thread uses client culture.
    "You can’t just ask customers what they want and then try to give that to them.
    By the time you get it built, they’ll want something new.” Steve Jobs
Sign In or Register to comment.