Logga in med Microsoft
Logga in eller skapa ett konto.
Hej,
Välj ett annat konto.
Du har flera konton
Välj det konto som du vill logga in med.

Symptom

När du har installerat någon av säkerhets uppdateringarna för September 2018 för .NET Framework för att lösa CVE-2018-8421 (.NET Framework-sårbarhet för fjärrkörning av kod), slutar arbets flöden utanför lådan att fungera. När det här problemet uppstår loggas en fel post av följande slag:

<Date> <Time> w3wp.exe (0x1868) 0x22FC SharePoint Foundation Workflow Infrastructure 72fs Unexpected RunWorkflow: Microsoft.SharePoint.SPException: <Error><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1" Text="Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file." /><CompilerError Line="-1" Column="-1"…

Felvärdet föreslår att system. CodeDom. CodeBinaryOperatorExpression inte ingår i de godkända typerna.

Mer information om säkerhets uppdateringarna för september .NET finns på den här blogg sidan för Microsoft .net.

Orsak

Workflow Foundation (WF) kör endast arbets flöden när alla beroende typer och sammansättningar är godkända i .NET config-filen (eller uttryckligen genom kod) i följande träd:

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

<authorizedTypes>

<targetFx>

Men efter uppdateringen krävs vissa typer som används av SharePoint-arbetsflöden som inte är obligatoriska för tillfället.

Lösning

Lös problemet genom att tillämpa lämplig säkerhets-och säkerhets uppdateringar från följande Knowledge Base-artiklar:

4461501 Beskrivning av säkerhets uppdateringen för SharePoint Enterprise Server 2016:13 november 2018 4461508 november 2018, kumulativ uppdatering för SharePoint Foundation 2013 (KB4461508) 4461510 november 2018, kumulativ uppdatering för SharePoint Enterprise Server 2013 (KB4461510)   4011713 november 2018, uppdatering för SharePoint Foundation 2010 (KB4011713) 4461528 november 2018, kumulativ uppdatering för SharePoint Server 2010 (KB4461528)

Kommentarer

  • När uppdateringen har installerats måste konfigurations guiden för SharePoint-produkter köras för att korrigeringen ska kunna tillämpas fullt ut.

  • Vissa tredje part eller anpassade arbets flödes åtgärder kan ha ytterligare beroenden. Om du upplever ett problem som liknar det här problemet men som inte diskuteras i den här artikeln kan du läsa mer om detta i avsnittet om att utveckla arbets flödes åtgärder.

Lösning

Undvik problemet genom att uttryckligen lägga till nödvändiga typer i Web. config-filen för alla program. Även om det finns manuella steg rekommenderar vi att du använder skript metoden. 

Lös problemet genom att uttryckligen lägga till nödvändiga typer i Web. config-filerna för alla program.

För SharePoint 2013 och senare versioner

För SharePoint 2013 och senare versioner lägger du till följande rader:

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

För SharePoint-versioner äldre än SharePoint 2013

För SharePoint-versioner som är äldre än 2013 lägger du till följande rader i stället:

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

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

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

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

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

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

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

Vi rekommenderar att du kör följande skript i stället för att direkt ändra befintliga filer.

Obs! Vissa tredjeparts arbets flödes motorer kan kräva att extra typer läggs till. Om så är fallet kontaktar du leverantören för information om vilka typer som behövs och justerar sedan skriptet.

Följande skript ändrar Web. config för alla webb program för att lägga till de poster som behövs. Det här skriptet lägger till dessa typer för befintliga webb program och för program som skapas när skriptet körs. Skriptet bör bara köras en gång på valfri front webb server i Server gruppen (det uppdaterar alla servrar).

<#

 This script adds 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 has to run only one time.

SUMMARY:

This script uses 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 that are added at 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 have to manually update the web.config by 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 has to be run only one time 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 entries owned by "NetFrameworkAuthorizedTypeUpdate"

 

    .DESCRIPTION

       Removes any web configuration entries 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

    {

    }   

}

# The following command will get the timerjob responsible for the web.config change deployment

# Get-SPTimerJob | ? { $_.Name -eq "job-webconfig-modification" }

 

# The following command will make the appropriate changes

Add-CodeDomAuthorizedType

# Remove the following command if you have to remove the web.config updates, you can use this function to retract the changes

# Remove-CodeDomAuthorizedType

Behöver du mer hjälp?

Vill du ha fler alternativ?

Utforska prenumerationsförmåner, bläddra bland utbildningskurser, lär dig hur du skyddar din enhet med mera.

Communities hjälper dig att ställa och svara på frågor, ge feedback och få råd från experter med rika kunskaper.

Hade du nytta av den här informationen?

Hur nöjd är du med språkkvaliteten?
Vad påverkade din upplevelse?
Genom att trycka på skicka, kommer din feedback att användas för att förbättra Microsofts produkter och tjänster. IT-administratören kan samla in denna data. Sekretesspolicy.

Tack för din feedback!

×