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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading