Answered by:
Unable to publish workflow that has e-mail step

Question
-
Hello everybody,
I'm unable to publish any workflows that have e-mail steps. The returned message is:
"An error occured when the workflow was being created. Try to save the workflow again."
I've been back to the e-mail (via Set Properties) and everything looks OK. If I use a template then I don't run into the same problem.
I enabled tracing and found this entry that would appear to be relevant to the problem:
Code Snippet>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.Error Number: 0x80045001
Error Message: Workflow compilation failed:
WF1399: 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.Error Details: Workflow compilation failed:
WF1399: 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.Source File: Not available
Line Number: Not available
Stack Trace Info: [CrmException: Workflow compilation failed:
WF1399: 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.]
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)[CrmException: Workflow compilation failed:
WF1399: 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.]
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompletePublishing(WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.Publish(BusinessEntityMoniker moniker, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WorkflowService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker , Int32 , Int32 , ExecutionContext )[TargetInvocationException: Exception has been thrown by the target of an invocation.]
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)[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.companyname__grid_cmds_dlg_activate_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)Can anybody point me in the right direction? Any direction will do as I'm going round in circles at the moment!
I could publish these workflows in the past without any problems. The only thing that has changed is that I had to reinstall CRM / re-import the organisation because my trial couldn't be converted with the license key I was issued with.
Thanks in advance.
Wednesday, January 14, 2009 3:58 PM
Answers
-
We have managed to resolve the issue with Rollup 2.....basically the installation is NOT updating the web.config correctly when first installed and is then missing a number of authorized type entries that are required to compile the workflows.
We Uninstalled and then kept a copy of the web.config and then reinstalled (it then works) and then compared the web.config
We have now applied to our client's production environment as we have a new CRM implementation starting Monday with a extensive number of workflows....fingers crossed!
Listed below are the lines that are missing ...
<!--
* 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"/>Regards
Tom
- Proposed as answer by mhdhallak Tuesday, February 24, 2009 2:23 PM
- Marked as answer by DavidJennawayMVP, Moderator Friday, May 29, 2009 8:36 PM
Friday, January 23, 2009 1:51 PM -
Phew.
Installation of Update Rollup 2 solved my problem.
Tuesday, January 20, 2009 10:22 PM
All replies
-
I once got this behaviour when the email I was trying to send to was not in CRM. Try adding a record with the email address and see if this fixes the problem.Leon Tribe
Want to hear me talk about all things CRM? Check out my blog
http://leontribe.blogspot.com/Wednesday, January 14, 2009 11:49 PM -
Hi Lee Campbell,
I suspect your email workflowconfigure to use email template to send email.
So now, isn't the template still exist in CRM, or someone go and remove it already?
THis will cause the workflow validation fail.
regards,
toong yang
Thursday, January 15, 2009 7:30 AM -
Hi,
Thanks for the responses.
Leon Tribe wrote: I once got this behaviour when the email I was trying to send to was not in CRM. Try adding a record with the email address and see if this fixes the problem. I've tried various recipeint types, all with valid email addresses but with the same error result.
Toong Yang wrote: I suspect your email workflowconfigure to use email template to send email.
So now, isn't the template still exist in CRM, or someone go and remove it already?
THis will cause the workflow validation fail.
Actually, if I use a template then it works OK (i.e. I can publish the workflow).
This morning I have run into the same problem when attempting to publish a workflow that doesn't have an email step. The workflow in question simply changes the status of a custom entity record based on the value in a custom field.
Thursday, January 15, 2009 9:58 AM -
Are you at all able to create any workflow activity in your system?
And in the case of status change activity, what is the error you see?
Thursday, January 15, 2009 6:32 PM -
Hi,
Yes, some workflows I can publish successfully. For example, I can create workflows that use email templates. I've not tried each and every variation yet but have also been successful with publishing workflows that have update steps and that assign records to other users.
However, I've just tried to publish another test workflow, one that has a create step, but fails to publish. The error is always the same: "An error occurred when the workflow was being created. Try to save the workflow again."
Thursday, January 15, 2009 9:40 PM -
Phew.
Installation of Update Rollup 2 solved my problem.
Tuesday, January 20, 2009 10:22 PM -
Hi Lee,I'm having the exact same problem. However, installing Rollup 2 didn't fix it. The knowledge base mentions a number of hotfixes that need to be enabled manually. Did you need to enable any of these hotfixes?Thanks,
JeffryWednesday, January 21, 2009 3:41 PM -
Hi Lee, lucky you! We have installed Update Rollup 2 and it has caused this problem! When we uninstalled Update Rollup 2, we are once again able to publish workflows that contain Send E-mail actions.
Unfortunately, we've got hosted customers waiting for us to deploy Update Rollup 2 to fix regression errors introduced by Update Rollup 1, but based on this workflow problem, we're awaiting further advice from Microsoft Premier Support.
Regards, Neil
Wednesday, January 21, 2009 4:23 PMModerator -
Hello Jeffry / Neil,
I'm having the exact same problem. However, installing Rollup 2 didn't fix it. The knowledge base mentions a number of hotfixes that need to be enabled manually. Did you need to enable any of these hotfixes?
What I had done just before was reinstall CRM and then re-apply Rollup 1. I had almost given up hope and was ready to resort to a call to PSS when I discovered that Rollup 2 was available. As soon as that was applied and the server rebooted everything was OK.
Sorry I can't be of help. I hope you both find a solution soon!Wednesday, January 21, 2009 9:47 PM -
We have managed to resolve the issue with Rollup 2.....basically the installation is NOT updating the web.config correctly when first installed and is then missing a number of authorized type entries that are required to compile the workflows.
We Uninstalled and then kept a copy of the web.config and then reinstalled (it then works) and then compared the web.config
We have now applied to our client's production environment as we have a new CRM implementation starting Monday with a extensive number of workflows....fingers crossed!
Listed below are the lines that are missing ...
<!--
* 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"/>Regards
Tom
- Proposed as answer by mhdhallak Tuesday, February 24, 2009 2:23 PM
- Marked as answer by DavidJennawayMVP, Moderator Friday, May 29, 2009 8:36 PM
Friday, January 23, 2009 1:51 PM -
Tom Cadman wrote:
<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>Regards
Tom
Solved my problem! Thanks Tom!
PS Trace your log files:
Crm Exception: Message: Workflow compilation failed:
Type System.Globalization.CultureInfo is not marked as safe ... in web.config
(I've non english .NET Framework, so above message can be writte not in exact these words)
- Proposed as answer by mhdhallak Tuesday, February 24, 2009 2:23 PM
Tuesday, January 27, 2009 3:24 PM
HT
Hi,
We have managed to resolve the issue with Rollup 2.....basically the installation is NOT updating the web.config correctly when first installed and is then missing a number of authorized type entries that are required to compile the workflows.
We Uninstalled and then kept a copy of the web.config and then reinstalled (it then works) and then compared the web.config
We have now applied to our client's production environment as we have a new CRM implementation starting Monday with a extensive number of workflows....fingers crossed!
Listed below are the lines that are missing ...
<!--
* 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"/>