I am trying to publish a Core 1.0 app to a 2012R2 box that runs fine locally in IIS Express.
All I get is:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
In this article from Microsoft it only mentions that a 403.14 Forbidden error is created by picking the wrong directory for the site... which is not the case.
VS does NOT pusblish the web.config, however. And there is no choice for 'copy to server always' or 'content' (in DDL), both choices are missing.
Check if there is web.config in your application's folder. If there is no web.config in the folder IIS don't know it's an ASP.NET Core application, it thinks you are trying listing the file in that folder. So if you set IsTransformWebConfigDisabled property in the project configuration to true, which caused Web.config file isn't generated in the publish folder when build it. So Change the IsTransformWebConfigDisabled property to false in YourProjectName.csproj file like this:-
<IsTransformWebConfigDisabled>false</IsTransformWebConfigDisabled>
Make sure that the service account / user credentials set on the application pool has access to run / access the app. That was my issue when deploying to IIS a few times.
As for including the web.config, make sure to include the following code in your project.json file. Just specify what you want to include in the publish.
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
}
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