error after changing RuntimeVersion = 'v2.0' to 4.0

after changing the runtimeversion to 4.0
I get this error:

Log Name:      microsoft-windows-dsc/operational
Source:        Microsoft-Windows-DSC
Event ID:      4097
Task Category: Send configuration scenario for Local configuration manager
Level:         Error
Keywords:      
User:          SYSTEM
Computer:      334sdgfddddd
Description:
This event indicates that failure happens when LCM is processing the configuration. ErrorId is 0x1. ErrorDetail is The SendConfigurationApply function did not succeed.. ResourceId is [cIISAnonymousAuth]dangerdev.com_Anonymous_Auth and SourceInfo is C:\Hosting-Server\Hosting_Server.ps1::965::17::cIISAnonymousAuth. ErrorMessage is The PowerShell DSC resource cIISAnonymousAuth threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details..
Event Xml:

  
    
    4097
    0
    2
    1
    0
    0x4000000000000000
    
    275783
    
    
    microsoft-windows-dsc/operational
    334sdgfddddd/Computer>
    
  
  
    {ABCE421D-C097-11E7-80FB-0050568B5513}
    LCM
    0x1
    The SendConfigurationApply function did not succeed.
    [cIISAnonymousAuth]dangerdev.com_Anonymous_Auth
    C:\Users\Hosting-Server\Hosting_Server.ps1::965::17::cIISAnonymousAuth
    The PowerShell DSC resource cIISAnonymousAuth threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
  

if I open the site using IIS I get an error saying the web.config has a duplicate line number 6 “system.web.extension/scripting/scriptresourcehandler section defined”

LINE 6 from the web.config is:

         

it does change the runtimeversion but not sure why its complaining about permissions now.?
thanks