Custom Workflow assembly RRS feed

  • Question

  • Hi,

    I created a custom workflow assembly and registered. When I try to publish the workflow after adding a step with custom workflow which i registered I am getting below error.

    "An error occurred when the workflow was being created. Try to save the workflow again."

    Monday, July 21, 2008 6:16 AM


All replies

  • Here is the complete description of error in the event viewer

    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 7/21/2008 11:54:04 AM
    Event time (UTC): 7/21/2008 6:24:04 AM
    Event ID: 186a842895a64f73b13e5cd6c9f088e3
    Event sequence: 500
    Event occurrence: 12
    Event detail code: 0
    Application information:
        Application domain: /LM/W3SVC/1/ROOT-1-128610934782968750
        Trust level: Full
        Application Virtual Path: /
        Application Path: c:\inetpub\wwwroot\
        Machine name: CRM
    Process information:
        Process ID: 4728
        Process name: w3wp.exe
    Exception information:
        Exception type: TargetInvocationException
        Exception message: Exception has been thrown by the target of an invocation.
    Request information:
        Request URL:{4D75E60C-BF0D-4945-B685-06233B6D5627}
        Request path: /osmosysorg1/_grid/cmds/dlg_activate.aspx
        User host address:
        User: CRM0\shashi
        Is authenticated: True
        Authentication Type: Negotiate
        Thread account name: NT AUTHORITY\NETWORK SERVICE
    Thread information:
        Thread ID: 13
        Thread account name: NT AUTHORITY\NETWORK SERVICE
        Is impersonating: False
        Stack trace:    at Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception)
       at Microsoft.Crm.Dialogs.ActivateDialogPage.ConfigureForm()
       at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    Custom event details:

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Monday, July 21, 2008 6:33 AM
  • I'd start again with this information and be sure you've followed the required steps: http://technet.microsoft.com/en-us/library/cc151142.aspx


    Also, it's always a good idea to compare your code to a working example (http://blogs.msdn.com/crm/archive/2008/06/20/custom-workflow-activity-for-matching-email-addresses-to-customers.aspx). If you can publish a pre-coded example then you can start looking at your code to see where you need to make changes.



    Monday, July 21, 2008 6:38 AM
  • Even if I write a workflow which does nothing as below I am getting the same error.

        class Test : SequenceActivity
            protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
                return base.Execute(executionContext);
    Monday, July 21, 2008 10:23 AM
  • Verify the DependencyProperty.Register propertyType and ownerType parameters are correct.


    A workflow with the following code will throw this exception because the propertyType parameter doesn't match the DeliverCost property type, CrmMoney.


    public static DependencyProperty DeliveryCostProperty = DependencyProperty.Register("DeliveryCost", typeof(CrmNumber), typeof(CalculateQuote));


    [CrmOutput("Delivery Cost")]

    public CrmMoney DeliveryCost




    return (CrmMoney)base.GetValue(DeliveryCostProperty);




    base.SetValue(DeliveryCostProperty, value);



    • Proposed as answer by akylitis Thursday, October 15, 2009 3:58 PM
    Wednesday, September 10, 2008 8:29 PM
  • Here, we have the same problem in two different CRM installations. We have restarted both machines and nothing seems to change. We've restarted the MS CRM Asyncronous Service several times and make a lot of IIS resets and still the same problem.

    We can't publish any workflow althought we could before because we have a few plugins and workflows already registered.

    Please, any help will be appreciated.

    PS: the workflow assemblies are strongly signed and the code has been reduced to the minimum expression to avoid code errors.
    Thursday, September 18, 2008 2:11 PM
  • We having this same very issue. We have found no solutions either. Can anyone help?
    Thursday, December 4, 2008 9:18 PM
  • I believe that the problem is that you haven't declared your SequenceActivity class as "public". Change the line

    class Test: SequenceActivity


    public class Test: SequenceActivity

    This will allow the class to be visible to external code, and thus callable by CRM.

    Good luck!
    Adam Oellermann
    Thursday, December 11, 2008 9:27 AM
  • How do I do that? I originally created this workflow using the wizard.

    Monday, December 29, 2008 12:32 PM
  • Anonymous9040600 !!

    Thank you very much...

    We had exactly the same problem. We were using the Lookup class from the webreference whern declaring the CrmInput but on the
    DependencyProperty.Register the Lookup class used was the one from the sdk. As a consequence we got exactly the same problem described on this post.

    The solution was to use the same Lookup class from the webreference.

    Friday, September 25, 2009 11:28 AM
  • This pointed out the problem for me. In my case it was caused by the class for my custom code having the same name as the class for my custom code in a different workflow.

    Since I copy-pasted the code the class names were the same. After trying to save a workflow with two different classes with the same name, this error occurs. Looking closer at the types of the parameters solved this problem, since the parameters contain the name of the class.

    Thank you.
    Friday, January 29, 2010 9:03 PM