locked
Breakpoint Not Hit RRS feed

  • Question

  • I have a plugin that I originally deployed in the database. Initially I could debug it. However, later on the breakpoints got the yellow exclamation mark and would not trigger anymore. According to the MS info I read it's more straight forward to deploy the plugin to Disk for debugging. Hence I

    * Unregistered the plug in
    * Deleted all files in server\bin\assembly
    * Recompiled my project and copied the dll and pdb into the server\bin\assembly
    * Registered the plugin to Disk

    However, the breakpoints are still not being hit. From previous research I understand this happens if the wrong pdb file has been picked up. However, I don't see any other pdb file anywhere. I believe with a regular exe file I could go to the menu Debug->Windows->Modules to see which pdb file was picked up. However, I don't see the "Modules" menu item. Where can I check for that and/or why does my breakpoint not get triggered?

    Btw, I use an on-premise deployment and attach to all the w3wp.exe processes (typically 3-4).

    Wednesday, January 23, 2013 8:14 AM

Answers

  • Hi,
       The plugin dll and pdb files should be placed in C:|Program Files\Microsoft Dynamics CRM\Server\bin\assembly folder.

       Is it happening only for this plugin? Did you try debugging any other plugin and is it working? - This will tell you whether the problem is with the environment or with your plugin

       I hope you have registered your plugin on Sync Mode not in ASync mode. Check it once.

       Just for the sake of time, try changing the plugin to ASync and attach it to CrmAsynService to do debug.


    Vikranth Pandiri http://howto-mscrm.blogspot.com TweetVikranth "Please Mark it as answer if it helps in resolving your query"

    • Marked as answer by hfaun Thursday, January 24, 2013 4:29 PM
    Thursday, January 24, 2013 5:18 AM

All replies

  • Hi,

    May be it won't solve your issue but did you try iisreset ?


    Contact Me
    Follow me on Twitter
    My Facebook Page
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, January 23, 2013 8:22 AM
    Moderator
  • Mahender, thanks for the reply. I did try iisreset at various stages but it does not help. I also rebooted the computer between unregistering the plugin and registering it again.

    On interesting observation is that when I do an iisreset the following happens:

    * All w3wp.exe files disappear (as expected)
    * Only after I do something on CRM (like updating a record) one w3wp.exe process appears under "Attach to Process". That one shows no Type.
    * When I attach to that w3wp.exe process I get the breakpoints in solid red (though they don't trigger)
    * Later additional w3wp.exe processes show up. Their type is Managed (v2....)
    * As soon as I attach to these additonal w3wp.exe processes the breakpoints get the yellow exclamation mark (and still don't trigger)

    Wednesday, January 23, 2013 8:46 AM
  • Hi,

    Try adding an empty line to your solution, then rebuild and re-register it. It helped me in a similar case.

    Wednesday, January 23, 2013 9:53 AM
  • hi hfaun,

    the file you are using to debug the plugin might not the same file(dll) in crm environment,

    build your plugin again, and update(dll) using plugin registration tool.

     


    Thanks and Regards. Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, January 23, 2013 10:15 AM
  • I did try many things and my combinations including changing a file recompiling, clean the project and rebuild the project, change version numbers, to iisresets at different stages, etc. but nothing helped. My plugin consists of 3 projects:

    * The plugin itself
    * The generated code for early-binding
    * A custom library of general functions

    In my project I have a post-built that does an ILMerge of all three projects. I ended up not using the ILMerge but copied all three dlls into the assembly directory. On the positive side, my plugin suddenly does not blow up anymore. However, it still does not trigger the breakpoint. So here are the questions:

    * Why does the breakpoint not get triggered (original question)?
    * How do I deploy a plugin that depends on other dlls CRM Online?

    Wednesday, January 23, 2013 6:41 PM
  • It should not matter that you have the plugin registered in the database.  The key question is if your plugin is registered to run in the sandbox or not.  If it is registered in the sandbox you will place your pdb file in the C:|Program Files\Microsoft Dynamics CRM\Server\bin\assembly folder.  You will recycle the sandbox service, then you will attach to the sandbox service on that machine.

    If your plugin is not registered on the sandbox you will place your pdb file in the C:|Program Files\Microsoft Dynamics CRM\CRMWeb\bin folder, recycle the CRMAppPool in IIS, then attach to the W3WP on that machine.

    Note that the .pdb file must match exactly the .dll that got deployed.

    -JayB

    Wednesday, January 23, 2013 7:50 PM
  • JBaeske, thanks. I do not use the sandbox and register to disk. I did the following:

    * Remove all dlls and pdbs (plugin dll requires iisreset)
    * Close down internet explorer
    * Rebuild whole project
    * Put all 3 dlls into server\bin\assembly
    * Put all 3 pdbs into CRMWeb\bin
    * iisreset
    * Register my plugin from the debug folder (also tried server\bin\assembly)
    * iisreset
    * Attach to w3wp.exe (attaching to one gives the reg solid circle, attaching to two removes it with exclamation mark)
    * Perform action to trigger plugin

    Btw, I have not heard of putting the pdbs into crmweb\bin before. I am following

    http://msdn.microsoft.com/en-us/library/gg328574.aspx
    http://msdn.microsoft.com/en-us/library/gg309620.aspx

    Wednesday, January 23, 2013 10:17 PM
  • Hi,
       The plugin dll and pdb files should be placed in C:|Program Files\Microsoft Dynamics CRM\Server\bin\assembly folder.

       Is it happening only for this plugin? Did you try debugging any other plugin and is it working? - This will tell you whether the problem is with the environment or with your plugin

       I hope you have registered your plugin on Sync Mode not in ASync mode. Check it once.

       Just for the sake of time, try changing the plugin to ASync and attach it to CrmAsynService to do debug.


    Vikranth Pandiri http://howto-mscrm.blogspot.com TweetVikranth "Please Mark it as answer if it helps in resolving your query"

    • Marked as answer by hfaun Thursday, January 24, 2013 4:29 PM
    Thursday, January 24, 2013 5:18 AM
  • I had this same problem earlier while debugging plugins, thus had to switch the approach. You may follow the same and I hope it should solve your problem.

    http://crm.ipiyush.me/debug-plugin-in-dynamics-crm-2011/

    (I'm having some hosting issues thus you might see a 404 error, but scroll down and you'll see the actual content of the post)


    Piyush

    Thursday, January 24, 2013 5:29 AM
  • Close and reopen the Visual studio with 'Run as administrator'.

    • Insert the breakpoint
    • Attach w3wp.exe (Breakpoint will go like circle)

    But you proceed with triggering the plugin and check.

    Thursday, January 24, 2013 8:05 AM
  • The only other thing I can think of:  Is your plugin step registered to run asynchronously?  If so, you will restart the Dynamics CRM Asynchronous Service, and attach to the Asynchronous process.
    Thursday, January 24, 2013 1:24 PM
  • Thanks everybody for the replies. I really appreciate it. Vicky made some suggestions and his last one about switching to was the easiest and quickest to try. So I did go to that particular step, clicked on Update and switched it from Sync to Async. Then I tried to attach to CrmAsynService but could initially not find out until I realized I had to select "Show Processes From All Users". Interestingly, now the breakpoint suddenly got triggered. So I switched back from ASync to Sync and it still did get hit. I kept working for a few more hours last night, rebooted the system today and tried it again and it still worked, knock on wood.

    I am not quite sure what to make out of that as I did not make any changes to the code at all except switching from Sync to Async to Sync. I suspect that somehow the step was not properly registered (the plugin/dll itself was probably ok because I updated it many times).

    One curiosity I still have is that after I copy the dll and pdb to the server\bin\assembly folder I cannot register it. The plugin registration tool always fails. Then on the second attempt it works. I always do an iisreset before copying the dll and pdb file to the server\bin\assembly because they are usually locked.

    Thursday, January 24, 2013 4:29 PM