Compartilhar via


Solucionando Problemas: Could not load type 'System.ServiceModel.Activation.HttpModule' (pt-BR)

Introdução

Na estrutura tenho duas maquinas virtuais, uma chamada Hm07 com o Configuration Manager 2012 e a Hm04 com o SQL Server 2008 R2. O sistema operacional dos servidores é o Windows Server 2008 R2 Service Pack 1. Após a instalação do Application Catalog não é possivel acessar o portal das aplicações 

http://4.bp.blogspot.com/-VX8HpEOwygk/TrHXDKw6GvI/AAAAAAAAB70/rkg9rC2cl-A/s320/sccm.jpg

Sintoma

Após instalar os roles Application Catalog Web Service Point e *Application Catalog Website Point *

http://1.bp.blogspot.com/-ojQFlUMtFB8/TuYxsOHcK2I/AAAAAAAACbo/huS4tf9t_KU/s320/ErrwebApp01.png

O texto do erro:

Server Error in '/CMApplicationCatalog' Application.
--------------------------------------------------------------------------------


Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 


Exception Details: System.TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


Source Error: 


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  


Stack Trace: 




[TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +314
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +95
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +76


[ConfigurationErrorsException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +11355388
   System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +69
   System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +62
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +301
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1332
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +149
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375


[HttpException (0x80004005): Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309


 




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

No Component Status no console do Configuration Manager nos logs do componente SMS_AWEBSVC_CONTROL_MANAGER

http://4.bp.blogspot.com/-_tkPdB5xTDg/TuY0zzfBtAI/AAAAAAAACbw/sjQyjmjnPhY/s320/ErrwebApp02.png

O texto do erro:

Date:           12/12/2011
Time:           12:12:01
Site Code:            HMO
System:            Hm7.home.intranet
Source:     SMS Server
Component:    SMS_AWEBSVC_CONTROL_MANAGER
Type:    Milestone
Severity:            Error
Message ID:   8101
Process ID:   1916
Thread ID:           2692

Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests.  The http error is 12002.

Causa

Este erro ocorre quando a server feature WCF Activation é instalado no servidor com o .Net Framework 4.0 já instalado.

Solução

Para resolver este problema execute o comando 
aspnet_regiis.exe /iru

Este executável esta na pasta

  • %windir%\Microsoft.NET\Framework\v4.0.30319
  • %windir%\Microsoft.NET\Framework64\v4.0.30319 (em maquinas 64bits)

http://3.bp.blogspot.com/-kmXZsQj4VPM/TuY5Okxig3I/AAAAAAAACb4/Iycvoysu8LU/s400/ErrwebApp03.png

Após executar o comando o evento é logado no console do Configuration Manager

http://4.bp.blogspot.com/-eB_uclLgDM4/TuY6ULZbMNI/AAAAAAAACcA/BzyNecn0b18/s320/ErrwebApp04.png

 Texto do evento:

Date:           12/12/2011
Time:           13:12:01
Site Code:            HMO
System:            Hm7.home.intranet
Source:     SMS Server
Component:    SMS_AWEBSVC_CONTROL_MANAGER
Type:    Milestone
Severity:            Information
Message ID:   8102
Process ID:   1916
Thread ID:           2692

Application Web Service Control Manager detected AWEBSVC is responding to HTTP requests.

Este artigo foi originalmente escrito por:
Fernando Lugão Veltem
**blog: **http://flugaoveltem.blogspot.com 
**twitter: **@flugaoveltem