Server Error in Application - System.ServiceModel.Activation.HttpModule

Follow

Rev: 1.0
Date: September 8, 2014

Problem:

When attempting to view the dashboards in your ERPM or RPM website installation or when attempting to view the web service for your ERPM installation, you receive the following or similar message:

Code:
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) +11621355
   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) +264
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1356
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +149
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
   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) +11792384
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4941237

Cause:

The ERPM web service and the ERPM/RPM dashboards both require the use of the Microsoft .Net 4.x framework. The error can be caused when the proper .Net framework is not installed, configured, or properly registered.

Resolution:

For resolution, please check the following items:

  • Microsoft.Net 4.x Framework is installed
  • The Application pool is set to the .Net 4.x framework
  • Dashboards application pool = PWCDashBoards or RPMDashboards
  • Web Service application pool = ERPMAppServicePool


If the .Net 4.x framework is installed and the application pools are set to use the .Net 4.x Framwork, the problem is likely caused by an order of install problem. Please see the following article from Microsoft on the subject: Troubleshooting: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel...'. In short, This error can occur when there are multiple versions of the .NET Framework on the computer that is running IIS, and IIS was installed after .NET Framework 4.0 or before the Service Model in Windows Communication Foundation was registered.

The resolution to the error is to open an administrative command prompt and properly register the correct framework.

To register the correct version of ASP.NET

  1. On the computer that is running Microsoft Dynamics NAV Web Server components, open a command prompt as an administrator as follows:
  2. From the Start menu, choose All Programs, and then choose Accessories.
  3. Right-click Command Prompt, and then choose Run as administrator.
  4. At the command prompt, type the following command to change to the Microsoft.NET\Framework64\v4.0.30319 folder, and then press Enter.

    cd\Windows\Microsoft.NET\Framework64\v4.0.30319
  5. At the command prompt, type the following command, and then press Enter.

    aspnet_regiis.exe -iru
  6. At the command prompt, type the following command, and then press Enter.

    iisreset



Applies To:

Enterprise Random Password Manager (ERPM)
Random Password Manager (RPM)

Was this article helpful?
0 out of 0 found this helpful

Comments

Powered by Zendesk