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.
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
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
ASP.NET 4.5 is installed.
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?
The error message itself points out the location of the duplicate entries. To resolve this problem, delete the duplicate entry in the ApplicationHost. config file for the authorization rule.
IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.
Solution. Open IIS Manager, select root node( the hosting server), in the middle panel double click Feature Delegation. In right panel select Custom Site Delegation..., In upper part of middle panel, click the drop down list and select your site. In Action panel click Reset All Delegation.
HttpPlatformHandler is a prerequisite so you need to install it,
https://azure.microsoft.com/en-us/blog/announcing-the-release-of-the-httpplatformhandler-module-for-iis-8/
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164 ]
The hosting model from ASP.NET 5 Beta 8 has changed and is now dependant on the IIS HttpPlatformHandler.
You will notice your web.config in the wwwroot folder or your application contains references to it.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
The above %DNX_PATH% translates to "..\approot\web.cmd"
ASP.NET BETA 8 release notes
Hosting ASP.NET 5 applications in IIS will now be achieved using the IIS HttpPlatformHandler configured to forward through to the ASP.NET 5 Kestrel server. The HttpPlatformHandler is a native IIS module that needs to be installed by an administrator on the server running IIS (installers: x86, x64). It’s also already included with the beta8 Web tools update for local development on IIS Express. This native IIS module manages the launching of an external application host process (in this case dnx.exe) and the routing of requests from IIS to the hosted process.
You can install the HttpPlatformHandler using the Microsoft Web Platform installer or separate x86 / x64 installers on download links from Microsoft's IIS site: link.
Take note: The HttpPlatformHandler only supports IIS 8 +. So this means for older operating systems like Windows Server 2008 R2 which comes with IIS 7.5, you won't be able to use IIS to host ASP.NET 5 websites since those version don't support the HttpPlatformHandler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With