Error while publishing CRM 4.0 Workflow

I have seen this error three times now, the first time I made a recommendation to contact Microsoft Premier Support, the second time I worked it out, and this third time I decided it was worth blogging about.

The error is very simply when you attempt to publish a workflow you receive a rather unhelpful "The workflow cannot be published" such as the picture below.  This behavior seems to occur straight after applying an Update Rollup, however seems to occur far more frequently after Update Rollup 3 and 4.

Workflow Error

The following more helpful error is recorded in the Event Log :

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 6/19/2009 10:53:10 AM
Event time (UTC): 6/19/2009 12:53:10 AM
Event ID: 63e4987779424d0b8eb93fca2566a7cf
Event sequence: 13175
Event occurrence: 6
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-128897723456212507
    Trust level: Full
    Application Virtual Path: /
    Application Path: c:inetpubwwwroot
    Machine name: XXXXXXX
 
Process information:
    Process ID: 9116
    Process name: w3wp.exe
    Account name: NT AUTHORITYNETWORK SERVICE
 
Exception information:
    Exception type: TargetInvocationException
    Exception message: Exception has been thrown by the target of an invocation.
 
Request information:
    Request URL: http://CRM/CRM/_grid/cmds/dlg_activate.aspx?iObjType=4703&iTotal=1&iIndex=0&iId={FC6EF8AE-96F6-427B-9F21-24E9A7E9E85B}
    Request path: /CRM/_grid/cmds/dlg_activate.aspx
    User host address: 10.3.0.146
    User: Username
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: NT AUTHORITYNETWORK SERVICE
 
Thread information:
    Thread ID: 1
    Thread account name: NT AUTHORITYNETWORK 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)

After much digging and poking I finally tried comparing the web.config file of the CRM server experiencing this error to another server which had not yet had an update rollup done, and immediately I noticed a major difference.  There were four lines missing from the AuthorizedTypes section of the config file!

Missing from Auth Types

 Immediately I took a backup of the existing web.config and then added those four lines in, Bingo!  Immediately I was able to publish workflows.  From a bit of research I did after finding this I was able to find out that this problem was thought to be resolved post Update Rollup 2, however judging from these results this is not the case.  Not so easy to find, but very easy to fix.  My suspicion is that the error will only show up when the web.config was previously modified after the initial installation of CRM, which would explain why we are seeing this semi-frequently on hosting environments, especially the ones with a large amount of customizations.

The four lines I applied into the web.config follow :

      <authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System"  TypeName="Void" Authorized="True"/>
      <authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection"  TypeName="AssemblyFileVersionAttribute" Authorized="True"/>
      <authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection"  TypeName="AssemblyVersionAttribute" Authorized="True"/>
      <authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>

Advertisement

4 Responses to Error while publishing CRM 4.0 Workflow

  1. Marc says:

    Very helpful !
    Thank you

  2. Ian Luxton says:

    Hi, this article is amazing. I have used the info on (too) many occasions. Just applied Rollup 14 to a complicated CRM install with only Rollup 1 previously applied and the only issue that arose was this one.

    Many thanks for this gem.

  3. Linn Myat says:

    this article really help me.
    thank you much….

  4. chandrshubh says:

    Thanks…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: