tugberk
tugberk

Reputation: 58434

HTTP 500.21 error while starting a web site directly through iisexpress.exe

When I try to run a web site directly through iisexpress.exe, I am getting an error. This happens for all web sites. The command I used is as below:

.\iisexpress.exe /site:MultipleRoutes

The site starts up successfully but I am getting the following error:

HTTP Error 500.21 - Internal Server Error

Handler "ExtensionlessUrl-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

I am assuming that somehow the website is not running under ASP.NET but when I fire up the sites through VS, there is no problem.

Any idea?

Edit:

Here is another fact: when I try to run the web site by specifying the path instead of the site name registered inside the applicationHost.config file, the site runs perfectly fine:

.\iisexpress.exe /path:D:\Dropbox\Apps\MultipleRoutes /port:1672 /clr:v4.0

Upvotes: 4

Views: 12382

Answers (8)

HashAndCoding
HashAndCoding

Reputation: 1

Reinstall your .NET framework

This problem occurs when IIS is installed later .NET framework .The simple solution is to reinstall your .NET framework again or check repair on installation wizard . Or you can install the latest version of .NET framework....... https://www.microsoft.com/en-in/download/details.aspx?id=49982 I had the same problem while configuring DNN 8 for first time.

Upvotes: 0

user4490367
user4490367

Reputation: 1

You need to upgrade.

Run C:\Program Files\IIS Express\UpgradeApplicationHost.js

Worked for me when migrating from 32 to 64 bit.

Upvotes: -2

Fadi Barakat
Fadi Barakat

Reputation: 1

just run the register asp.net .. u can find it at C:\Windows\Microsoft.NET\Framework64\v4.0.30319 .. run it through the cmd (Administrator ) as below :

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i u r gonna b just fine ...

Upvotes: 0

Chetan Sheladiya
Chetan Sheladiya

Reputation: 67

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

Something for others to keep in mind as they struggle like me through this process.

Upvotes: 1

Daniel Dolz
Daniel Dolz

Reputation: 2421

This worked for me:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

Upvotes: 16

Thomas Bratt
Thomas Bratt

Reputation: 51764

Below are the complete changes I needed to make to run my x64 bit IIS application using IIS Express, so that it was accessible to a remote host:

iisexpress /config:"C:\Users\test-user\Documents\IISExpress\config\applicationhost.config" /site:MyWebSite
Starting IIS Express ...
Successfully registered URL "http://192.168.2.133:8080/" for site "MyWebSite" application "/"
Registration completed for site "MyWebSite"
IIS Express is running.
Enter 'Q' to stop IIS Express

The configuration file (applicationhost.config) had a section added as follows:

<sites>
  <site name="MyWebsite" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="C:\build\trunk\MyWebsite" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation=":8080:192.168.2.133" />
    </bindings>
  </site>

The 64 bit version of the .NET framework can be enabled as follows:

<globalModules>
    <!--
        <add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness32" />
        <add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
    -->             
    <add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />

Upvotes: 0

Sean Hanna
Sean Hanna

Reputation: 331

This was a 32 bit vs. 64 bit issue for me, where the applicationHost.config in my user profile directory only contained 32 bit module declarations but was trying to run in 64 bit.

The IIS Express installation contained a valid 64bit configuration in C:\Program Files\IIS Express\AppServer so i just overwrote the one in my profile directory with this one and things started working.

Upvotes: 5

Scott Forsyth
Scott Forsyth

Reputation: 1194

It sounds like your user applicationHost.config may have something wrong in it. If you go to your documents folder and then \config\applicationhost.config you should see the config file that iisexpress is using. Search for ManagedPipelineHandler and ExtensionlessUrl. Does anything stand out as being amiss?

Upvotes: 2

Related Questions