MS CRM 4.0 Unable to Publish Workflows

PROBLEM: 
  • You cannot publish a workflow in CRM, with the following error appearing "An error occurred when the workflow was being created. Try to save the workflow again." 
  • None of the rollups fix the problem - or, one of the rollups caused the problem. 
  • Client is running Windows Vista. 
  • Server is running Windows 2003 family, including SBS2003. 


SOLUTION THAT WORKED FOR ME:

Various rollups over time have modified the web.config file to include various configuration lines. Some of these modifications can fail.

The solution to this one's all over the internet, but the solution isn't consistent. The best and quickest one seems to be:

Take a backup of your web.config file, then modify it to add the following under the <authorizedTypes> tag at the end before the </authorizedTypes> tag:

<authorizedType Assembly=”mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ Namespace=”System.Globalization” TypeName=”CultureInfo” Authorized=”True”/>

However, I would suggest you also look at the following three lines and see if any of these are missing from the file also. If you, add these in too:

<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"/>

After making the changes above, restart IIS.

The above three lines came from http://www.msexperts.org/blogs/mark/archive/2009/06/19/error-while-publishing-crm-4-0-workflow.aspx

The reason for differences in opinion over which lines to add back in relates firstly to the different rollups everyone has installed and secondly to comparisons some people have made between a backup version of the web.config file they have retained and the current appearance of their file. A definitive list of changes to the web.config file can be found here: http://support.microsoft.com/kb/968793



OTHER POSSIBLE SOLUTIONS: 
  • Uninstall the latest rollup to revert to previous one. If this works try to re-install the rollup again. 
  • Try installing the latest rollup. Information on all the latest hotfixes and rollups is located here http://support.microsoft.com/kb/949256
If none of these work, call Microsoft Support, as it could be some hitherto unknown thing that will commit you to an insane asylum if you try to figure it out alone.