none
SPD Workflows - Error on Publishing RRS feed

  • Question

  • I have an issue where SPD workflows are showing the attached error at the time of publishing on one web application! SP2010 Farm it is, and at the same time, SPD workflows are publishing and working fine on another web app on the same farm.

    Complexity or simplicity of the workflow is not relevant in this scenario, because a very simple one step workflow without any conditions is even failing to publish on the problematic web app! 

    Currently investigating, but any relevant info shared will be gratefully received indeed. 

    Wednesday, June 26, 2019 9:41 PM

All replies

  • Hi helloSP,

    Try running the below Script from any one of the WFE Server:

    <#
    
     This script will add the entries to all web.config files for all web applications in the farm.
    
     Run this script as Farm Administrator in one of the WFEs.
    
     This script only needs to run one time.
    
    SUMMARY: 
    
    This script leverages the native SharePoint SPWebConfigModification API to deploy new updates to the web.config file for each web application on each server in the farm.  Servers added a later date will also get the updates applied because the API configuration is persisted in the config database.  This API does not update the web.config for the central administration web application. 
    
    If you are running workflows on the central admin web application, you will need to manually update the web.config using the steps in the referenced blog.
    
    ==============================================================
    
    #>
    
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
    
    function Add-CodeDomAuthorizedType
    
    {
    
        <#
    
        .Synopsis
    
           Adds the necessary authorizedType elements to all web.config files for all non-central admin web applications 
    
     
    
        .DESCRIPTION
    
           Adds the necessary authorizedType elements to all web.config files for all non-central admin web applications 
    
     
    
        .EXAMPLE
    
           Add-CodeDomAuthorizedType
    
     
    
        #>
    
        [CmdletBinding()]
    
        param
    
        (
    
        )
    
        begin
    
        {
    
            $farmMajorVersion = (Get-SPFarm -Verbose:$false ).BuildVersion.Major
    
            $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    
            $typeNames = @( "CodeBinaryOperatorExpression", "CodePrimitiveExpression", "CodeMethodInvokeExpression", "CodeMethodReferenceExpression", "CodeFieldReferenceExpression","CodeThisReferenceExpression", "CodePropertyReferenceExpression")
    
        
    
        }
    
        process
    
        {
    
            if( @($contentService.WebConfigModifications | ? { $_.Name -eq "NetFrameworkAuthorizedTypeUpdate" }).Count -gt 0 )
    
            {
    
                Write-Warning "Existing NetFrameworkAuthorizedTypeUpdate entries found, this script only need to be run once per farm."
    
                return
    
            }
    
            if( $farmMajorVersion -le 14 ) # 2010, 2007
    
            {
    
                foreach( $typeName in $typeNames )
    
                {
    
                    # System, Version=2.0.0.0
    
                    $netFrameworkConfig = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
    
                    $netFrameworkConfig.Path     = "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes"
    
                    $netFrameworkConfig.Name     = "authorizedType[@Assembly='System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'][@Namespace='System.CodeDom'][@TypeName='{0}'][@Authorized='True']" -f $typeName
    
                    $netFrameworkConfig.Owner    = "NetFrameworkAuthorizedTypeUpdate"
    
                    $netFrameworkConfig.Sequence = 0
    
                    $netFrameworkConfig.Type     = [Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode
    
                    $netFrameworkConfig.Value    = '<authorizedType Assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.CodeDom" TypeName="{0}" Authorized="True"/>' -f $typeName
    
                
    
                    $contentService.WebConfigModifications.Add($netFrameworkConfig);
    
                }
    
            }
    
            else # 2013+
    
            {
    
                foreach( $typeName in $typeNames )
    
                {
    
                    # System, Version=4.0.0.0
    
                    $netFrameworkConfig = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification
    
                    $netFrameworkConfig.Path     = "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes/targetFx"
    
                    $netFrameworkConfig.Name     = "authorizedType[@Assembly='System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'][@Namespace='System.CodeDom'][@TypeName='{0}'][@Authorized='True']" -f $typeName
    
                    $netFrameworkConfig.Owner    = "NetFrameworkAuthorizedTypeUpdate"
    
                    $netFrameworkConfig.Sequence = 0
    
                    $netFrameworkConfig.Type     = [Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode
    
                    $netFrameworkConfig.Value    = '<authorizedType Assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.CodeDom" TypeName="{0}" Authorized="True"/>' -f $typeName
    
                
    
                    $contentService.WebConfigModifications.Add($netFrameworkConfig);
    
                }
    
            }
    
            Write-Verbose "Updating web.configs"
    
            $contentService.Update()
    
            $contentService.ApplyWebConfigModifications();
    
        }
    
        end
    
        {
    
        }    
    
    }
    
    function Remove-CodeDomAuthorizedType
    
    {
    
        <#
    
        .Synopsis
    
           Removes any web configuration entires owned by "NetFrameworkAuthorizedTypeUpdate"
    
     
    
        .DESCRIPTION
    
           Removes any web configuration entires owned by "NetFrameworkAuthorizedTypeUpdate"
    
     
    
        .EXAMPLE
    
            Remove-CodeDomAuthorizedType
    
        #>
    
        [CmdletBinding()]
    
        param()
    
        begin
    
        {
    
            $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    
        }
    
        process
    
        {
    
            $webConfigModifications = @($contentService.WebConfigModifications | ? { $_.Owner -eq "NetFrameworkAuthorizedTypeUpdate" })
    
            foreach ( $webConfigModification in $webConfigModifications ) 
    
            {
    
                Write-Verbose "Found instance owned by NetFrameworkAuthorizedTypeUpdate"
    
                $contentService.WebConfigModifications.Remove( $webConfigModification ) | Out-Null
    
            }
    
            
    
            if( $webConfigModifications.Count -gt 0 )
    
            {
    
                $contentService.Update()
    
                $contentService.ApplyWebConfigModifications()
    
            }
    
        }
    
        end
    
        {
    
        }    
    
    }
    
    # will get the timerjob responsible for the web.config change deployment
    
    # Get-SPTimerJob | ? { $_.Name -eq "job-webconfig-modification" }
    
     
    
    # The command below will make the appropriate changes
    
    Add-CodeDomAuthorizedType
    
    # remove # below if you need to remove the web.config updates, you can with this function to retract the changes
    
    # Remove-CodeDomAuthorizedType 
    Thanks & Regards,

    sharath aluri


    Wednesday, June 26, 2019 10:34 PM
  • Hi hellosp,

    Go to “C:\inetpub\wwwroot\wss\VirtualDirectories\relevant web app port”,  open the web.config file and find out the “<authorizedTypes>” tag.

    Check if there is authorized type reference to workflow action is missing when you compare the web.config file between working web application and problematic web application. If so, add it and check again.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, June 27, 2019 9:32 AM
  • Hi hellosp,

    I’m checking how the things are going on about this issue. Whether the post helps you?

    You can mark the post as answer if it helps.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, July 1, 2019 9:23 AM