How to refresh C# files without restarting Service Tier/RTC?

lvanvugtlvanvugt Member Posts: 774
edited 2011-10-06 in NAV Three Tier
Last week I had, for the first time, the need to debug a process running on RTC. Various helpful post helped me to get it working quite easily. Thanx all for that. :thumbsup:

However, today trying to fix the error I had to debug so I am frequently updating and (re)compiling my code in CSIDE, it seems that the .cs files that have been generated in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\ (I am on Win7) are not refreshed.
The only way sofar I did get these files updated was by restarting the Service Tier. This quite time consuming so I was wondering: is there a more efficient way?
Luc van Vugt, fluxxus.nl
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    is it client server or only one machine?
    if 1 machine, set logon settings to local in your services..

    ex:
    if page48 is open in visual studio and we have done some modification in code in page48
    once if we go back to visual studio, it will ask for whether to reload or not...
  • lvanvugtlvanvugt Member Posts: 774
    Hi Mohana, thanx, but sofar no use unfortunately.
    is it client server or only one machine?
    1 machine
    once if we go back to visual studio, it will ask for whether to reload or not...
    Indeed I am getting that but only when restarting the Service Tier.
    if 1 machine, set logon settings to local in your services..
    This seems to make no difference.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    lvanvugt wrote:
    if 1 machine, set logon settings to local in your services..
    This seems to make no difference.

    Hi Luc,

    this should work..please check once again..
    it worked for me with local setting..

    After setting, restart the service and do the process from begining..
  • deV.chdeV.ch Member Posts: 543
    I had similar issues with R2 and normal changes on page objects. (debuging was disabled), i had to change MetadataProviderCacheSize to 0.
  • lvanvugtlvanvugt Member Posts: 774
    it worked for me with local setting..
    Just to be sure: with this you mean that I should run the NAV Service Tier under Local System Account?
    I have set it to run under the Local System Account but to no avail. :(
    deV.ch wrote:
    I had similar issues with R2 and normal changes on page objects.
    Good to hear I am not the only one.
    deV.ch wrote:
    I had to change MetadataProviderCacheSize to 0.
    Did not help unfortunately.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • deV.chdeV.ch Member Posts: 543
    Maybe you realy need to restart the service to have your c# files updated, from the CustomSettings.config:

    With the EnableDebugging flag set to true the Microsoft Dynamics NAV Server
    will start with debugging mode enabled. This mode has three main functions:
    1) Upon first connection by a RoleTailored Client all C# for that application
    will be generated.
    2) C# files will be persisted between server restarts.
    3) Application Objects will be compiled with debug information.
  • lvanvugtlvanvugt Member Posts: 774
    I also read that bolded sentence, so I guess there is no other way. ](*,)

    Meanwhile I did run into another issue. See this post: http://www.mibuso.com/forum/viewtopic.php?f=32&t=46405.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • DenSterDenSter Member Posts: 8,307
    I ran into this topic while helping a coworker figure out how to debug RTC stuff. What we saw was that a new codeunit did not make it into the source folder at all. No cs file was generated for this codeunit, not after saving/compiling, not after restarting the service tier, and not after starting the RTC after restarting the service tier.

    The only way we could make this happen was by adding a CODEUNIT.RUN statement as a page action, and actually running that action.

    Which brings me to another observation that is relevant for this topic. What I observed is that when you modify an object, the act of saving/compiling does NOT refresh the cs file. However, you don't need to restart the service tier to have it updated. You DO need to run the process from the RTC.

    So for me, I had a simple 'hello world' codeunit, with a page action that runs the codeunit. When I modified the codeunit in C/SIDE it did not trigger a cs file update. When I ran the action from the RTC it DID update the cs file.
Sign In or Register to comment.