locked
Cannot debug asynchronous Plugin on my local machine RRS feed

  • Question

  • I have several Plugins that are registered to execute asynchronously that I need to debug to troubleshoot why they are not working correctly.  I've researched all the articles I can find that describes how to debug asynchronous Plugins but nothing works.  The debug symbols never load and my breakpoints are never hit.

    The machine on which I am trying to debug is a newly created VM (VMWare Workstation).  The CRM Database was imported using the Deployment Manager.  I've confirmed that I have all the necessary DB permissions.  I've also changed the Logon account associated with the CRM Asynch Service to run under my credentials.  The only other factor I can think that might have anything to do with this problem is the AD folder that CRM was pointed at during the initial installation.  How does AD effect this if at all?  This was working fine on my old development machine which was not a VM.  Could that have any part in this problem?

    Wednesday, March 31, 2010 5:42 PM

Answers

  • This issue has been resolved.  I ended up opening a Support Ticket with the CRM Team.  The problem was being caused by my domain account not being a member of the PrivUserGroup Group in AD.  Once I was added to the Group I could debug Plugins running asynchronously.  I still needed to change the Log On credentials for the CRM Asynch Service to be running under my account to attach to the process using Visual Studio, but at least I can debug now.
    • Marked as answer by rmcmullen Monday, April 5, 2010 5:30 PM
    Monday, April 5, 2010 5:30 PM
  • As Blake has pointed out, you need to make sure a few things to debug async code:

    1. Make sure Async service is running
    2. Make sure you have .pdb file in server\bin\assembly folder
    3. Make sure to attach to CrmAsyncService.exe process (NOT the w3wp.exe one)

    You don't have to do iisreset if you have the plug-in assembly stored in database when you register the plug-in, which is usually believe to be better practice.


    Daniel Cai | http://danielcai.blogspot.com
    • Proposed as answer by HIMBAPModerator Wednesday, March 31, 2010 7:05 PM
    • Marked as answer by Jim Glass Jr Wednesday, March 31, 2010 9:44 PM
    Wednesday, March 31, 2010 6:03 PM

All replies

  • Make sure your plugin's .pdb file is in <CRMInstallPath>\Server\bin\assembly.  Also you need to restart your async service and possibly iisreset the CRM Server everytime you update your plugin and .pdb file.

    Do you need to debug it asynchronously?  Another option would be to register it synchronous just for debugging, if it's easier for you to debug synchronously.

    Wednesday, March 31, 2010 5:53 PM
  • As Blake has pointed out, you need to make sure a few things to debug async code:

    1. Make sure Async service is running
    2. Make sure you have .pdb file in server\bin\assembly folder
    3. Make sure to attach to CrmAsyncService.exe process (NOT the w3wp.exe one)

    You don't have to do iisreset if you have the plug-in assembly stored in database when you register the plug-in, which is usually believe to be better practice.


    Daniel Cai | http://danielcai.blogspot.com
    • Proposed as answer by HIMBAPModerator Wednesday, March 31, 2010 7:05 PM
    • Marked as answer by Jim Glass Jr Wednesday, March 31, 2010 9:44 PM
    Wednesday, March 31, 2010 6:03 PM
  • As I mentioned I have already followed the various articles out there on how to debug Plugins which address the .pdb file(s).  I've already resorted to debugging synchronously, but that doesn't fix the underlying problem of why I can't debug asynchronously.
    Wednesday, March 31, 2010 9:02 PM
  • As I mentioned I have already followed the various articles out there on how to debug Plugins which address the .pdb file(s).  I've already resorted to debugging synchronously, but that doesn't fix the underlying problem of why I can't debug asynchronously.
    Wednesday, March 31, 2010 9:02 PM
  • See my reply to Blake's response.
    Wednesday, March 31, 2010 9:03 PM
  • It might help if you can show us your code and where you set the breakpoint.
    Daniel Cai | http://danielcai.blogspot.com
    Wednesday, March 31, 2010 9:43 PM
  • This is not a code issue because as I've stated in my original message the debugging worked on my old machine, same code!
    Thursday, April 1, 2010 1:57 AM
  • This is not a code issue because as I've stated in my original message the debugging worked on my old machine, same code!
    Thursday, April 1, 2010 1:57 AM
  • This issue has been resolved.  I ended up opening a Support Ticket with the CRM Team.  The problem was being caused by my domain account not being a member of the PrivUserGroup Group in AD.  Once I was added to the Group I could debug Plugins running asynchronously.  I still needed to change the Log On credentials for the CRM Asynch Service to be running under my account to attach to the process using Visual Studio, but at least I can debug now.
    • Marked as answer by rmcmullen Monday, April 5, 2010 5:30 PM
    Monday, April 5, 2010 5:30 PM