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

1

11

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.

Peralta answered 15/8, 2015 at 19:29 Comment(9)
The error goes away if I add a default document which makes it look like requests are not being routed through ASP.net.Peralta
Do you have .net installed and asp.net registered on the server with IIS?Rhaetia
The server currently serves up .net 4.5.1 sites just fine, but it does feel like iis doesn't know about .net 5.0Peralta
IIS doesn't need to know what framework you're using in your project. It's the AspNet.Loader.dll's job to figure out which framework to load. Do you have the app pool set to 4.0?Rhaetia
Right OK that makes sense, Yes the App pool is set to v4.0.Peralta
Hmm ok. Could you attach an mcve?Rhaetia
In your wwwroot\bin folder there should be the AspNet.Loader.dll file - do you have it there?Wilfordwilfred
Yes there is an AspNet.Loader there. I get this with a default project but can upload the source.Peralta
Seems a permission issue. In IIS the application you created should be linked to an application pool. Go to that selected application pool and in Actions select Advanced Settings. Under Process Model->Identity change it to LocalSystem. You should then get another error but you'll at least have gotten further.Youngyoungblood
O
1

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

Overvalue answered 20/11, 2015 at 17:39 Comment(2)
Thanks as soon as I have fixed my migration issue and can run my project I will give it a try!Peralta
+1. Solved after installing httpPlatformHandler on server and setting Site Physical Path to .../wwwroot (Windows Server 2008 R2, IIS 7.5, MVC 6)Myca

© 2022 - 2024 — McMap. All rights reserved.