Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta] 

Hi,

I have faced today with this issue in a Microsoft Dynamics CRM installation. Some workflows I were able to publish and some other weren't.

I just got the generic error: 'An error occurred when the workflow was being created. Try to save the workflow again'. No more usefil info in eventviewer.

 

Cause

After some reseach I found that this error may be caused if you applied some rollup or hotfix and the web.config file you have is not the default one, but has been manually modified (due to some ISV needs , for instance). This knwoledge base article talks about it.

In this case, the rollup / hotfix setup realizes that the web.config was manually modified and hence does not automatically update it to support rollup/hotfix changes.

Then, a manually update to web.config is needed.

 

Solution

As said above, I had to manually apply changes to web.config that should have been applied by hotfix/rollup setup but weren't because the file were manually manipulated.

The changes I applied were all within authorizedTypes section. In concrete, I added the following items to this section:

<authorizedTypes>

....

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" 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" TypeName="Math" Authorized="True" /> <authorizedType Assembly="Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Crm.SdkTypeProxy" TypeName="CrmService" Authorized="False" />

<authorizedType Assembly="Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Crm.SdkTypeProxy.Metadata" TypeName="MetadataService" Authorized="False" />

....

</authorizedTypes>

 

After applying this, I opened one of the workflows that presented the problem and I could publish it successfully.

 

Hope this helps to somebody else,

PP

 

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta]

5 Comments

Comments have been disabled for this content.