SharePoint 2016 – SharePoint designer workflow – resolving error – Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.) (0, 0) Activity ‘ID11’ validation failed: Property “Condition” has invalid value. Condition expression is invalid. The condition expression can not be null.)

SharePoint 2016 - Error while publishing the workflow
SharePoint 2016 - Error while publishing the workflow

Hi All,

Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂

Today new issue, and solution 🙂

Issue / Error – In SharePoint 2016, while publishing SharePoint Designer workflow getting following error

(-1, -1) Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration fType System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.) (0, 0) Activity ‘ID11’ validation failed: Property “Condition” has invalid value. Condition expression is invalid. The condition expression can not be null.)

SharePoint 2016 - Error while publishing the workflow
fig: SharePoint 2016 – Error while publishing the workflow

The error entry suggests that System.CodeDom.CodeBinaryOperatorExpression is not included in the authorized types

Details / Background :

  • We have migrated our SharePoint 2013 site to SharePoint 2016
  • We have few workflows as well which are migrated successfully
  • Workflow is made at List level
  • Workflow is assigning unique permission to folder on the given list item
  • When we try execute the workflow we were getting an error – “Workflow canceled by System account
  • There is nothing in ULS and History list as well
  • So thought to “Publish” the workflow again
  • While publishing the workflow we get the above error

Environment:

  • SharePoint 2016
  • SharePoint 2013 designer workflows – migrated from SharePoint 2013 to SharePoint 2016

Cause :

Workflow Foundation (WF) runs workflows only when all dependent types and assemblies are authorized in the config file (or added explicitly through code) in the following tree:

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

<authorizedTypes>

<targetFx>

Solution :

  • As per some blog posts we tried by activating “Workflow” feature but no luck 🙁
  • As per some blog posts we cleared SharePoint Designer Cache but no luck 🙁
  • Created new workflow on the same list but same issue
  • After bit searching it found that issue is with web.config file. There are several entries for “Authorised Assemblies” are missing
  • This is caused by the recent .Net security update on our box
  • Symptoms : SharePoint out-of-the-box workflows stop working
  • Following are the entries which we added in web.config file of our web application under the tree –

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

<authorizedTypes>

<targetFx>

 <authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeBinaryOperatorExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePrimitiveExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodInvokeExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeMethodReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeFieldReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodeThisReferenceExpression" Authorized="True" />

<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" NameSpace="System.CodeDom" TypeName="CodePropertyReferenceExpression" Authorized="True" />

After just adding these entries to web.config file of our web application we could published workflows successfully and running successfully 🙂

Please note – above entries are for the SharePoint 2013 and later versions. If you have SharePoint 2010 box then there are bit different entries

Thanks for reading 🙂 HAVE A GREAT TIME AHEAD 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: