The NAV Application Server (NAS), often called the Classic Server, runs Dynamics NAV code through a service and there is no graphical user interface (GUI). Without the GUI, there are some limitations on the C/AL code that can be executed through the NAS. C/AL Form and Dataport functions as well as Dialog system functions cannot be executed through the NAS. Without the a GUI, a different approach needs to be taken to debug code. It isn't always enough to step through the code as it runs in the NAV client because the resulting code may not always execute the same through the NAS.
Debugging the NAS is a lot easier than many may think. To debug the NAS, first verify that a developers license exists in the Application Server folder. Then start the NAS from the command line using the following syntax (this is different than installing the NAS as a service):
"C:\Program Files (x86)\Microsoft Dynamics NAV\60\Application Server\nassql.exe" Debug,Breakpoints=C:\Temp\Breakpoints.xml,appservername=JOBQUEUE,Servername=localhost,Database=Demo Database NAV (6-0),Company="CRONUS USA, Inc.",startupparameter=JOBQUEUE
Note: Replace the parameter values in the above statement with the values for your environment.
With the Debug parameter specified the debugger will open and you can set breakpoints and step through the code. The Breakpoints parameter is used to specify the file that is used to load a predefined set of breakpoints. This makes debugging a lot easier as you do not need to step through every line of code to find your desired breaks. If the breakpoints file does not exist it will be created when you close the application server session, if you had set any breakpoints.
Note: The Breakpoints file is nothing more than an XML file that contains the breakpoints location:
<?xml version="1.0" encoding="utf-8"?>
<Object Type="Codeunit" ID="449" Name="Job Queue Start Codeunit">
You can read more on the breakpoints file on MSDN.