Could not load type 'System.ServiceModel.Activation.HttpModule'

前端 未结 8 1451
不思量自难忘°
不思量自难忘° 2020-12-28 19:32

I am run aspnet_regiis.exe, still I am getting same error:

Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.Ser

相关标签:
8条回答
  • 2020-12-28 20:26

    Get to the applicationhost.config file in the following directory: C:\Windows\system32\inetsrv\config

    The following section will be defined:

    <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
    

    The above definition is incompatible with the .NET framework 4.0, you can get this issue resolved by replacing the above section by the following:

    <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
    
    0 讨论(0)
  • 2020-12-28 20:33

    On Windows 2012, the following worked :

    For a reason I don't know the default application pool was set up to use 4.0 :

    Application Pool Properties

    but it was not correctly reflected in c:\windows\system32\inetesrv\config\applicationhost.config :

    <add name="DefaultAppPool" enable32BitAppOnWin64="true" />
    

    I had to set it back to 2.0 and then to 4.0 again, and then the config file was fine and the error disapeared :

    <add name="DefaultAppPool" enable32BitAppOnWin64="true" managedRuntimeVersion="v4.0" />
    
    0 讨论(0)
提交回复
热议问题