c# – Publish and run ASP.NET 5 MVC WebAPI Service on IIS 8.5
c# – Publish and run ASP.NET 5 MVC WebAPI Service on IIS 8.5
In the last days I tried to publish a new created ASP.NET 5 WebAPI Webservice on an IIS 8.5.
But after publishing the Webservice didn’t started. I received the following error message:
HTTP Error 500.19 – Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.Detailed Error Information:
Module: IIS Web Core
Notification: Unknown
Handler: Not yet determined
Error Code: 0x8007000d
Config Error
Config File: \\?\C:\inetpub\wwwroot\[PathToService]\web.config
Requested URL: http://localhost:[Port]/
Physical Path
Logon Method: Not yet determined
Logon User: Not yet determinedConfig Source:
-1:
0:
To solve this error please follow the following instructions.
Software requirements:
- Windows Server 2012 R2
- IIS 8.5
- DNX Version: dnx-clr-x64.1.0.0-rc1-update
- Visual Studio 2015 Update 1 + AspNet5.ENU.RC1_Update1
Installation Server:
- Add at least the following server roles: Web Server (IIS) and ASP.NET 4.5
- Install the HttpPlatformHandler 1.2
(Important: this handler was missing in my environment and caused the above error) - Check and install the correct DNX version if not already installed.
– Open an command promt with administrative rights and first install the DNVM (.NET Version Manager):
Install DNVM@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1')
– Get a list of all currently installed DNX versions:
dnvm list
– Install the DNX version 1.0.0-rc1-update1 x64 or any other version depending on the publishing settings in Visual Studio.
dnvm install 1.0.0-rc1-update1 -arch x64
Publishing Site configuration in Visual Studio:
- Compile and publish your Web Project in Visual Studio to a local folder or directly to the server with the following settings:
Configuration: Release – x64 Target DNX version: dnx-clr-x64.1.0.0-rc1-update1 - Add a new website in IIS an setup the physical path to the wwwroot folder within the published folder.