Debugging Dynamics NAV Add-ins

The Problem

Working with Dynamics NAV add-ins can be time consuming. The issue with debugging Dynamics NAV add-ins is that every time you make a change to a dll you have stop the service, copy over the files, and start the service back up again.  Since our dev team works with add-ins on a daily basis, we came up with a way to easily copy them from the Visual Studio solution to the proper Dynamics NAV folders. Jason Down came up with most of the script, I have simply expanded on it and made it a bit more generic.

The Script

This script is a very simple windows batch file. It allows you to set what service you want to restart, where your dlls are, and if you only want to copy over certain files from within that folder with a filter.

You can change the defaults to something that better suits your system. The first argument is the service name. The second is what folder to copy from. You may want to default this to a project you are currently working on. The last arg is a filter for what folder if you don’t want to copy over all the files. By default all files will be copied over.

Simple usage using the batch file:

add-in usage

Output example:

output from copy script

Making things even easier

If you have a main project you are always coping from, but want to keep the script generic for other projects. You can make a shortcut. On your desktop, or wherever you want it, make a new shortcut that points to the script. After you enter in the location, insert your arguments. This way, to copy over your new add-ins, all you have to do is double click on your shortcut.

shortcut

Hopefully this saves you some time when developing and debugging Dynamics NAV add-ins.

 

Leave a Comment