How-to: Debug RTC

So there I was sitting, stuck on a process running on RTC, throwing errors that typically did not occur on Classic. No RTC specific debugger (yet). But … never to young to learn!

Unless C# is like cipher to you, it's not to difficult to get things working and go for it using these links:

Notes

  • As you are using the Visual Studio debugger you will need to have VS installed
  • Depending on where the code resides you are debugging either the RTC (code on pages) or the Service Tier (code on other CSIDE objects)
  • In case RTC and Service Tier are on different machines you have to debug on that specific machine
  • Before you start debugging you will need to identify the right C# code file and attach it to your process
  • Be sure to attach the C# file to the right process; if you are debugging either the RTC or the Service Tier you should attach to either Microsoft.Dynamics.Nav.Client.exe or Microsoft.Dynamics.Nav.Service.exe. Read here what happens if you take the wrong one.

  • To effectuate changes to your C/AL code so that they will show up in the VS debugger you have to restart the Service Tier; there is no other way to refresh the C# files

References

Some interesting forum posts to read:

Update March 6, 2012

Yesterday a good post on the NAV Team blog was released:

One Comment

  1. Hi Chris,

    Thanx for your comments!

    Some remarks:

    1. You always attach VS to the server.exe
      Sounds logic, but in some way it worked when I attached the page debugging to the client …. ???
    2. The source files are updated without restarting the service tier
      Well, didn't get that work, but maybe should do more tries
      update: just now it happened to me as you indicated; the .cs file indeed is updated and VS showed this dialog
    3. You can debug without opening a .cs file.
      OK, haven't tried that, but of course this trick will only work when the error is thrown. Not when I want to start debugging from a breakpoint on.

    b rg
    Luc

Leave a Reply

Your email address will not be published. Required fields are marked *