Pregunta

I have an AddIn DLL for Dynamics GP and I have an issue I can only reproduce on a client's server. As such I thought I would simply install Visual Basic Express 2010 on their server so I could do an "attach to process" and debug my DLL code. Then I discovered this function is not available in Express editions.

I have read this post on stackoverflow: Attach to process in VS2010 express using a web site. Is it possible?

I have also seen several online posts directing a "start external program" option. I do not see this exact option, instead I have a "working directory" field and a "command line arguments" box. Also, I am unsure if this would truly work conceptually with Dynamics GP - i.e. does setting this option correctly then launch GP when I start debugging the DLL?

Can you suggest a way to debug this add-in on the client's server? Otherwise I am stuck in a trial and error scenario of attempting to reproduce the error on my system as I have no observed pattern of the error's cause and I have already spent more time doing that than I would like.

¿Fue útil?

Solución

I know exactly how you feel. I have run into the same scenario myself several times where everything works fine in my environment but I get an error once deployed to a remote server.

What you need to do is download the Visual Studio 2010 Remote Debugger.

Install it on the remote server which is running Dynamics GP.

Rebuild your solution and then copy the .dll and pdb to the remote server AddIns folder. Be sure not to rebuild your solution again or make any changes. We want the dll and pdb deployed to the server to exactly match the build you have in your local development environment.

Now run the remote debugging tool as administrator. You will also probably want to change the mode to no authentication so you can easily attach to it. Go ahead and start Dynamics GP and log in.

Once the remote debugging tool is running on the remote server, go back to your local machine and in Visual Studio choose Debug -> Attach to Process. Type in the server name of your remote server. Choose the process which Dynamics GP is running under, usually Dynamics.exe to attach. Set a break point and then perform the action in Dynamics GP which causes your plug-in to fire.

If your breakpoint won't be hit, you can check the Modules windows in Visual Studio to see exactly which dlls and debugging info have been loaded into memory.

I also use this a lot to remote debug WCF services and CRM Plug-Ins. It is a very useful tool to have in your tool box.

One other note: I would recommend wrapping all of the code in your VST in a try catch that displays the detailed error message in a message box in GP. If your VST throws an error, many time GP will not indicate that it has a problem and won't display any error information.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top