Tuesday, February 9, 2010

Error publishing a workflow with an Email step

Recently I created a test workflow to send an email when a new task is assigned to any MS CRM user. Everything was in place but somehow the workflow just didn't publish and I kept getting the message:

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

This was what was logged in the MS CRM trace logs:
"Activity 'SendEmailStep4_policy' validation failed: Property "RuleSetReference" has an invalid value. Rule set is invalid. Rule "main" validation failed. Type System.Globalization.CultureInfo is not marked as authorized in the application configuration file."

And here is where I found the resolution:
http://social.microsoft.com/Forums/en/crmdevelopment/thread/e0a8b1f3-5bbf-4040-ab5c-2a67df362b5b

Add the following entries in the web.config file for Microsoft Dynamics CRM:

<!--
* CRM SE 6681 V4: Hotfix needed for CRM Workflows before WF.Net security patch
-->
<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"/>
<!--
* CRM SE 5934 V4: Workflow Designer and Runtime Do Not Handle Decimal Numbers Correctly
-->
<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>

Reset IIS and the workflow is successfully published.

No comments:

Post a Comment