Error publishing a workflow containing this step

Apr 24, 2009 at 9:55 AM
Hi

I cannot publish a workflow that uses the Share Record Workflow Step version 1.1.3.0.

When I try to publish I get an error saying "An error occurred when the workflow was being created. Try to save the workflow again."

I have pasted the event log entry below this email.

The assembly was successfully registered using the Plugin Registration Tool version 2.2.0.0.

The workflow has a single step which is shares the account record with the Sales team when it is created.

Please let me know if you need any more information.

Thanks

Mark



Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 24/04/2009 09:38:08
Event time (UTC): 24/04/2009 08:38:08
Event ID: fe48e2326c184b3dba1431f0775e4d2f
Event sequence: 748
Event occurrence: 5
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-128850126950143455
    Trust level: Full
    Application Virtual Path: /
    Application Path: c:\inetpub\wwwroot\
    Machine name: xxxx 
 
Process information:
    Process ID: 3932
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: TargetInvocationException
    Exception message: Exception has been thrown by the target of an invocation.
 
Request information:
    Request URL: http://xxxx/_grid/cmds/dlg_activate.aspx?iObjType=4703&iTotal=1&iIndex=0&iId={32E4E8E8-59B2-4BCA-9755-68F4B2EFC83E}
    Request path: /xxxx/_grid/cmds/dlg_activate.aspx
    User host address: xxxx 
    User: xxxx
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 18
    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.

Apr 24, 2009 at 11:05 AM
Forgot to add that I am using CRM 4.0 with Update Rollup 3.
Coordinator
Apr 27, 2009 at 7:19 PM
Hi Mark,

Hmm, this is annoying. It would be extremely helpful if you could enable tracing while you are trying to publish the workflow and send me the trace file. Unfortunately there's no way for me to "debug" your system, and the information you provided from the event log is too generic. The only one thing I can think of asking is whether you have installed the CRM SDK, in particular I think you need the microsoft.crm.sdk.ddl and microsoft.crm.sdktypeproxy.dll files.

To enable tracing (if you've never done it), this is the easy option: http://blogs.msdn.com/benlec/archive/2008/03/04/crmdiagtool4-for-microsoft-crm-4-0-has-been-released.aspx

Thank you in advance

Alberto
Apr 28, 2009 at 11:57 AM
Hi Alberto

I have generated the trace file as you suggested.

What is the best way to get the file to you as I cannot see a way to attach it to this discussion thread?

Regards

Mark
Apr 28, 2009 at 1:33 PM
Edited Apr 28, 2009 at 1:34 PM
Hi Alberto

I created a new record in Issue Tracker and attached the trace file to that.

Regards

Mark
Coordinator
Apr 29, 2009 at 5:43 PM
Hi Mark, so the error seems to be the following:

WF363: Type Infusion.CRM.WF.CRM40ShareStep.ShareRecordActivity, Infusion.CRM.WF.CRM40ShareStep, Version=1.1.26984.3, Culture=neutral, PublicKeyToken=838be80295bbee47 is not marked as authorized in the application configuration file., ErrorCode: -2147201023

I found this solution: http://randomdust.com/blogs/ryan/archive/2007/07/17/authorized-types.aspx

So I think you would need to add the following entry

<authorizedType Assembly="Infusion.CRM.WF.CRM40ShareStep, Version=1.1.26984.3, Culture=neutral, PublicKeyToken=838be80295bbee47" Namespace="Infusion.CRM.WF.*" TypeName="*" Authorized="True" />

to the System.Workflow.ComponentModel.WorkflowCompiler section in the web.config. Can you let me know if this solves the issue?

Thank you
Apr 30, 2009 at 3:42 PM
Yes! It worked. Thanks very much for your help with this.

Best wishes

Mark
Jun 2, 2009 at 11:18 AM

Hi, all !

I cannot publish a workflow that uses the Share Record Workflow Step too. :((

When I try to publish I get an error saying "An error occurred when the workflow was being created. Try to save the workflow again."

I don't know how can i edit web.config (System.Workflow.ComponentModel.WorkflowCompiler section).

Help, please..

Jun 2, 2009 at 11:24 AM

Hi Elka

Did you try adding the entry to the web.config as described in gemina's post?

Mark

Jun 2, 2009 at 11:49 AM

I understand!! Thank you!! It is super!

Aug 28, 2009 at 3:00 PM
Edited Aug 28, 2009 at 3:43 PM

Hi,

do I need to restart the server in order to make this new authorizedType entry be effective?

I did add this entry to web.config but I still get that same error as Gemina and Elka did.

Ruud

Nov 10, 2009 at 7:40 PM

SOS

Good Afternoon!

I am not able to publish workflows with the share in it.  I added the line mentioned above in the webconfig file.  I get the following errors.  Any thoughts?

 

Host CRMSANDBOX: failed while monitoring asynchronous operations queue. Exception: System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
    <head>
        <title>Configuration Error</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Configuration Error</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
            <br><br>

            <b> Parser Error Message: </b>Unrecognized element.<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

Line 10:   <sectionGroup name="System.Workflow.ComponentModel.WorkflowCompiler" type="System.Workflow.ComponentModel.Compiler.WorkflowCompilerConfigurationSectionGroup, System.Workflow.ComponentModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
Line 11:    <section name="authorizedTypes" type="Microsoft.Crm.ObjectModel.WorkflowAutorizedTypes, Microsoft.Crm.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<font color=red>Line 12:    <authorizedType Assembly="Infusion.CRM.WF.CRM40ShareStep, Version=1.1.26984.3, Culture=neutral, PublicKeyToken=838be80295bbee47" Namespace="Infusion.CRM.WF.*" TypeName="*" Authorized="True" />
</font>Line 13:
Line 14: </pre></code>

                  </td>
               </tr>
            </table>

            <br>

Nov 13, 2009 at 8:58 PM

Hi,

In my post above, I was logged on to the CRM server and could not publish the workflow.....but, when I log on to CRM via Web Browser, I can publish the workflow with no problem  :)

Have a great day :)

Voni

Feb 8, 2010 at 2:56 PM

Hi all.

I have a problem with publish workflows. When I try to publish I get  an error saying "An error occurred when the workflow was being created. Try to save the workflow again."

i edit web.config (System.Workflow.ComponentModel.WorkflowCompiler section). 

 ( i have sql 2008, server 2008, iis 7 )

help please..

Apr 15, 2010 at 8:50 AM
Edited Apr 15, 2010 at 8:50 AM

Hi guys,

"An error occurred when the workflow was being created. Try to save the workflow again." almost drove me mad. I did a trace log and found a lead to fix this issue.

There are a few thing you need.

1) Modify the CRM 4 website's web.config file (Make sure you backup the web.config file prior modifying it).
2) You need at least CRM 4 Rollup 2 which contains some fix. The later versions of Rollups will include this fix.

Take the following steps.

1) Edit the web.config file.
2) Add the following lines into "System.Workflow.ComponentModel.WorkflowCompiler" section (which is normally located at the bottom of the file)

<authorizedType Assembly="Infusion.CRM.WF.CRM40ShareStep, Version=1.1.26984.3, Culture=neutral, PublicKeyToken=838be80295bbee47" Namespace="Infusion.CRM.WF.*" TypeName="*" Authorized="True" />

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

3) Save the web.config file.

4) You are good to go. Try publishing your workflow.

Good luck ppl.

Regards,
Limmy

May 17, 2010 at 10:39 PM

Hi all,

In addition to Limmy's helpful post, make sure you change the 'version' number to be the same as the version you have registered. This tripped me up for a while so hopefully it will save someone a bit of time.

<authorizedType Assembly="Infusion.CRM.WF.CRM40ShareStep, Version=1.1.26984.3, Culture=neutral, PublicKeyToken=838be80295bbee47" Namespace="Infusion.CRM.WF.*" TypeName="*" Authorized="True" />