.NET Core发布到IIS问题-403.14 [英] .NET Core publishing to IIS problems - 403.14

查看:931
本文介绍了.NET Core发布到IIS问题-403.14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Core 1.0应用发布到2012R2框上,该框在IIS Express中可以在本地正常运行.

  • 在服务器上安装了DotNetCore.1.0.0-WindowsHosting.exe
  • 已安装httpPlatformHandler_amd64.msi
  • 将应用程序池设置为无托管代码"
  • 使用"Web Deploy"从VS发布
  • 撰写本文时,最新的VS Core工具

我得到的是:

HTTP错误403.14-禁止

Web服务器配置为不列出此内容目录.

关于包括web.config的信息,请确保在您的 project.json 文件中包括以下代码.只需指定要包含在发布中的内容即可.

 "publishOptions":{包括": ["wwwroot",视图","appsettings.json","web.config"]} 

I am trying to publish a Core 1.0 app to a 2012R2 box that runs fine locally in IIS Express.

  • Installed DotNetCore.1.0.0-WindowsHosting.exe on server
  • Installed httpPlatformHandler_amd64.msi
  • Set app pool to have 'no managed code'
  • published from VS using 'Web Deploy'
  • Latest VS Core Tools as of this writing

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.

解决方案

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"
  ]
}

这篇关于.NET Core发布到IIS问题-403.14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆