Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Error 403.14 - Forbidden asp.net 5 & MVC 6 iis10

I know this question has been asked and answered a few time but those questions are slightly different and the answers to those questions do not resolve my issue.

I have a asp.net 5 & MVC 6 application that works fine in IIS Express and self hosted in WEB. However when I publish to a folder and point IIS at the wwwroot folder I get the HTTP Error 403.14 - Forbidden error.

I have tried IISReset and I do have a default root.

like image 861
Code Junkie Avatar asked Aug 15 '15 19:08

Code Junkie


1 Answers

Requirements

  • Windows 7 or better
  • Windows Server 2008 R2 or better
  • Have IIS installed

Procedure

First, make sure you have the HTTP Platform Handler installed in your IIS (x86 / x64).

Publish your application to the file system and take the content of the \artifacts\bin\MyWebApp\Release\Publish folder and copy it into your IIS Server.

When configuring your application, target the wwwroot folder that you copied over.

Now you'll need to unlock the system.webServer/handlers section which can be found in IIS Manager on the server node under Configuration Editor. Search for the right section and unlock it from the right action pane.

Make sure that the App Pool is set to No Managed Code. DNX is being run as an external process. IIS doesn't need to know about what it's currently running.

Finally, create a web.config with the following content:

<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>

It should be running at that point.


Source

like image 80
Maxime Rouiller Avatar answered Nov 10 '22 00:11

Maxime Rouiller