Let's jump right in. We debug our Visual Studio applications over and over; and attaching to the test environment is among the most important, and time-consuming skills we use. (How many times have I launched GP2010 when I was thinking of GP2013?)
Of course we all simplify our testing by building the dll and pdb files directly in the Dynamics\Addins folder (right?). If not, start doing that.
Were that the only thing to learn here, that knowledge alone would be worth the price of admission. But it's a fairly obvious step, and many of us already send the built dll file to the folder.
The next level is launching and properly attaching to the right Dynamics process…automatically.
[A huge shout-out to Patrick Roth for showing me this.]
First, verify you are automatically building to the Dynamics\Addins folder. Otherwise the real value of this blog is blunted quite a bit.
With that sorted out, we can now simplify the Debug process.
Second, in the same Properties window as the First step above, select the Debug tab – this tab is the same for both C-Sharp and VisualBasic.
Finally, as needed:
Once it's set up properly, clicking on F5 should launch Dynamics for you. Behind the scenes, your code is automatically 'attached' to this instance of Dynamics.exe.
To fully see the power of this, place a 'Toggle Breakpoint' (F9) on the first line in your code's Initialize() method. Then click 'Start Debugging' (F5). The code should automatically break on that line after launching Dynamics. (Try doing that by 'Attaching To Process…')
Plus, once this is set up, I no longer launch GP2010 when I meant to launch GP2013 – except for the first time after an upgrade :-).
One thing to note is that the "start and attach" isn't supported with the free version of Visual Studio. Unless things are different in the most recent version, one limitation of the free version is that we cannot "attach to process" either this way or after the fact.
So while you can still build a vstools addin using the Express version, you cannot easily debug it.
Posting from Vaidy Mohan at Dynamics GP - Learn & Discuss
Kindly support me in debugging GP as i created GPAddin dll using VS 2008 and when i try to debug it and putting Break point it raise "no symbols have been loaded for this document"
and i need to debug urgent as it takes long time to run application and get values in message
your feedback is highly appreciated
As mentioned earlier the blog is not a vehicle for support. Please either log a support case or post on the community forums. As this is urgent I would suggest logging a support case.
Saludos, amigo Buttenhoff.
Seguí los pasos sugeridos, correctamente explicados y es lo que necesitaba.
Permítame agradecerle por su contribución. Me ha funcionado perfectamente.
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.