How toGeneral

General

Debug in NAV 2009

In this section the debugging in NAV 2009 is described. It differs from the standard debugging procedure in NAV Classic. In order to debug in NAV 2009:
  • Open the Sana Commerce solution in Visual Studio;

    If you use Windows Vista and have UAC turned on, you will need to open Visual Studio with 'Run as administrator'.
  • Enable debugging in the CustomSettings.config file which can be found here: C:\Program Files\Microsoft Dynamics NAV\60\Service;


    Debugging Option is Enabled

  • Restart the "Microsoft Dynamics NAV Server" service;
  • Setup connectionStrings in the 'web.config' file of the starter site project to connect to you NAV 2009 Server service;
  • Open the 'Codeunit11123311.cs' file (as an example) in Visual Studio;


    'Codeunit11123311.cs' File

  • Go to the 'GetDefaultCurrency' method and set breakpoint inside this method;


    Inserting the Breakpoint in the 'GetDefaultCurrency' Method

  • Attach the NAV service. Click 'Debug > Attach to process...' and attach 'Microsoft.Dynamics.Nav.Server.exe';


    Attaching the NAV Server Service

  • Run the solution in debug mode using Visual Studio: right click on the 'Sana.Commerce.StarterSite' project in Solution Explorer and click 'Debug > Start New Instance';


    Running the Project in Debug Mode

  • Now you are able to debug in NAV 2009.


    Debugging Process is Started
How toGeneral