locked
SalesOrder plugin not being executed RRS feed

  • Question

  • Hi guys

    I'm trying to test my first CRM 2011 plugin.  I've deployed it to my server using the plugin registration tool and registered it with the following step settings:

    Message: Update

    Primary Entity: salesorder

    Secondary Entity: none

    Filtering Attributes: all attributes

    Event Handler: my plugin DLL

    Run in User's Context: Calling User

    Execution Order: 1

    Event Pipeline Stage of Execution: Post Operation (CRM 2011)

    Execution Mode: Synchronous

    Deployment: Server

    Nothing seems to happen when I update a SalesOrder.  I tried to remote attach a debugger and hit some breakpoints, but again, nothing happens.  I wondered if there was an exception being hit, so added the following lines to the code to help debug:

            public void Execute(IServiceProvider serviceProvider)

            {

                StreamWriter oFile = new StreamWriter("c:\\tmp\\salesOrderDebugLog.txt");
                oFile.WriteLine("Execute started");
                oFile.Close();

    There's nothing recorded to the test file.

    How do I go about troubleshooting this further?

    Tks


    Steven
    Monday, October 31, 2011 2:13 PM

Answers

  • If you have registered the plugin on Disk and you are able to delete the plugin assembly without IISRESET it means the plugin is never fired and the assembly was not even loaded.

    Unregister the plugin assembly and try to register it all over again.

    You are not able to debug it or see.it working because it is never being fired.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Tuesday, November 1, 2011 1:01 AM
    • Marked as answer by steven_455 Tuesday, November 1, 2011 6:55 PM
    Tuesday, November 1, 2011 1:01 AM

All replies

  • You may want to try the following

    1. Try to delete the plugin assembly file from the bin folder. If you are able to delete it without any error... the plugin never fired. If it has fired it would not let you delete the assembly file.

    2. Recompile the plugin. Delete the existing plugin from bin folder. Copy the .dll and .pdb file to bin folder. Then attach to process w3p process

    3. If you are trying to create log file make.sure the folder where you are creating the file has full permission provided to Everyone.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Monday, October 31, 2011 2:23 PM
    Monday, October 31, 2011 2:23 PM
  • Tks Sam

    I tried to delete the DLL as you suggested (good suggestion) without resetting IIS - it deleted fine.

    I tried the recompile but no difference.

    Yes, Everyone has write permissions to my log file.

    When I registered the assembly originally I use "None" for the isolation mode and deployed to disk.  It occurred to me I would probably need to add something to web.config given the deployment, so I tried re-registering the DLL using Database for the location and reset IIS.  Still didn't make any difference.

    Any other ideas?

    Tks again


    Steven
    Monday, October 31, 2011 2:58 PM
  • If you have registered the plugin on Disk and you are able to delete the plugin assembly without IISRESET it means the plugin is never fired and the assembly was not even loaded.

    Unregister the plugin assembly and try to register it all over again.

    You are not able to debug it or see.it working because it is never being fired.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Tuesday, November 1, 2011 1:01 AM
    • Marked as answer by steven_455 Tuesday, November 1, 2011 6:55 PM
    Tuesday, November 1, 2011 1:01 AM