This topic has not yet been rated Rate this topic

Debugging Callouts

CRM 1.2
banner art

To debug callouts, here are some tips:

  • Make sure you have properly registered your callout.
  • Check the event log for errors.

If there are no errors in the event log, or the user is not seeing an error from your callout, the callout is probably not being loaded or called. This is most likely a configuration issue.

Make sure you have an up-to-date project data base (PDB) file available for your callout assembly. To make things easy, you can put the PDB in the same directory as your callout assembly. This way the debugger will automatically find and load it. The directory is:

C:\Program Files\Microsoft CRM\Server\bin\assembly

To debug a process, do the following:

  1. Load Microsoft Visual Studio 2003, or the Microsoft .NET GUID Debugger (The debugger is included in the Microsoft .NET v1.1 SDK).
  2. On the Debug menu, click Processes. You should see the following screen.

    Debugging processes

  3. Choose W3WP.exe, which is the WWW Work Process.

Note that, if there is more than one process, it is probably the one with ".NET" running in it. If there is more than one running .NET, click Attach and verify that you see the following:

Debugging processes

Choose the W3WP.exe process that is hosting "CrmCalloutHost".

  1. Select the Common Language Runtime check box.
  2. Click OK.

You are now debugging the process. If your PDB is properly loaded, you should be able to load your code and set break points, or, if there is an exception being thrown, Visual Studio will give you the option to "Break" into the code.

Another approach is to tell .NET to prompt the user to attach a debugger. To use this method, simply add the following code to your callout, and then recompile and re-deploy:

System.Diagnostics.Debugger.Launch()

Wherever this code is placed, .NET will stop the process and prompt you to attach a debugger. Click Cancel to let the code execute normally, or you may attach at that point in time.


© 2007 Microsoft Corporation. All rights reserved.


Did you find this helpful?
(2000 characters remaining)