.NET Core发布到IIS问题

编程入门 行业动态 更新时间:2024-10-15 22:23:16
本文介绍了.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问题

本文发布于:2023-11-17 00:09:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608086.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NET   Core   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!