locked
Can't run aspnet_regiis -iru on IIS8 to re-register ASP.NET RRS feed

  • Question

  • User1381472246 posted

    Short version

    In previous versions of IIS you could run aspnet_regiis -iru to correct any problems with aspnet registration, like this (Could not load type System.ServiceModel.Activation.HttpModule). What is the equivalent in IIS8 when you already have ASP.NET installed? 

    Longer Version

    This seems to be a problem many people have encountered but there's no very clear answer. e.g this question says uninstall/reinstall or this one says use Web Platform Installer.

    Here's my scenario: 

    I have a Win Server 2012 machine with ASP.NET installed. I needed to install a WCF 3.5 service so I ran this command to register the ServiceModel: 

        "%SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i

    That works fine and my WCF service runs perfectly as does my site that uses ASP.NET v2, however my site that uses ASP.NET v4 is broken with YSOD saying Could not load type System.ServiceModel.Activation.HttpModule

    I have tried: 

    • Uninstalling ASP.NET 4.5 and then reinstalling, using the Remove Roles and Features Wizard (which you can open from the Add Roles and Features Wizard). No luck, same problem.
    • Uninstalling ASP.NET 4.5 using the Remove Roles and Features Wizard, then installing ASP.NET using the Web Platform Installer (seemed like a bad idea but was suggested by a forum posting).

    Next thing to try is to uninstall ASP.NET 3.5 and 4.5, de-register the servicemodel from the command line, then re-install and include HTTP Activation (as suggested in comment to this post). Since it's a client's server this becomes a complete pain the butt...

    Does anyone have any other suggestions? 

    thanks, 

    Rory

    Monday, June 10, 2013 1:11 PM

Answers

  • User1381472246 posted

    The error I was having was "Could not load type System.ServiceModel.Activation.HttpModule" as described here: http://support.microsoft.com/kb/2015129

    On IIS7 or IIS7.5 the solution was to run aspnet_regiis -iru. This corrected a problem in the Applicationhost.config file. In IIS8 I was able to resolve the problem by editing the file manually, as described at that KB: 

    Edit the file %windir%\system32\inetsrv\config\applicationHost.config

    Change the section 

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

    to 

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

    (i.e. adding ",runtimeVersionv2.0" to the preCondition attribute.

    Save, retry. 


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 11, 2013 10:13 AM

All replies

  • User1381472246 posted

    The error I was having was "Could not load type System.ServiceModel.Activation.HttpModule" as described here: http://support.microsoft.com/kb/2015129

    On IIS7 or IIS7.5 the solution was to run aspnet_regiis -iru. This corrected a problem in the Applicationhost.config file. In IIS8 I was able to resolve the problem by editing the file manually, as described at that KB: 

    Edit the file %windir%\system32\inetsrv\config\applicationHost.config

    Change the section 

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

    to 

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

    (i.e. adding ",runtimeVersionv2.0" to the preCondition attribute.

    Save, retry. 


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 11, 2013 10:13 AM
  • User-166373564 posted

    Hi Rory

    On IIS7 or IIS7.5 the solution was to run aspnet_regiis -iru. This corrected a problem in the Applicationhost.config file. In IIS8 I was able to resolve the problem by editing the file manually, as described at that KB: 

    Edit the file %windir%\system32\inetsrv\config\applicationHost.config

    Thanks for your feedback about this issue,

    Glad that you've solved your problem by yourself, if you have anything urgent in your programming, please feedback by creating another thread,

    With regards

     

    Wednesday, June 12, 2013 9:31 PM
  • User-1939812703 posted

    Great, thanks for the solution! I had exactly the same problem. Too bad microsoft's support postings were useless.

    Monday, June 24, 2013 1:33 AM