Search code examples
iisdeploymentvisual-studio-2015asp.net-coreiis-8

IIS Deployed ASP.NET 5 BETA 8 site to IIS gives HTTP Error 500.19 - Internal Server Error


I created a new ASP.NET5 Beta 8 Web Application.

I publish it to my local file system and copy those files to my server which is a Windows Server 2012 R2

In IIS 8.5 on the server I create an application that uses an app pool that uses Process Model -> Identity as LocalSystem.

and I point the path to the wwwroot subfolder of the copied published application

My web.config

<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
  </system.webServer>
</configuration>

Running the URL on the server directly or clicking browse in IIS

http://localhost/WebApplication1

I get the following error

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

enter image description here

I am using the default web.config from the Visual Studio 2015 ASP.NET 5 Beta8 Web application template so I could only think it's perhaps the .net version.

I used the MSDN method to determine what version of .NET 4 is installed and it corresponds to .NET Framework 4.5.1

In my project.json I have

  "frameworks": {
      "dnx451": { }
  },

I compiled it as Win CLR when publishing

enter image description here

When I go to my approot folder in the deployment directory I can run the web.cmd web server and then access my website through the port created.

http://localhost:5000/

and this site works correctly.

If I view my IIS server roles installed components

enter image description here

ASP.NET 4.5 is installed.

enter image description here

Application pool is correct.

ASP.NET 4 websites run correctly in IIS using the same application pool

My questions 1. Why does IIS say the web.config is invalid? 2. How do I get a ASP.NET 5 Beta 8 site to run in IIS?


Solution

  • HttpPlatformHandler is a prerequisite so you need to install it,

    Updated: For RC2 and above, a new module called ASP.NET Core module is required instead of HttpPlatformHandler, and you can read this announcement.

    As this is a source of misunderstanding of HttpPlatformHandler and ASP.NET Core module, I wrote a post to clarify the history.