Publishing to IIS 发布到IIS

原文:https://docs.asp.net/en/latest/publishing/iis.html

发布到IIS

Publishing to IIS

By Rick Anderson and Luke Latham

Install the HTTP Platform Handler

If you need to enable IIS, see IIS server configuration.

Create Data Protection Registry Hive

To persist Data Protection keys you must create registry hives for each application pool to store the keys. You should use the Provisioning PowerShell script for each application pool you will be hosting ASP.NET 5 applications under.

For web farm scenarios developers can configure their applications to use a UNC path to store the data protection key ring. By default this does not encrypt the key ring. You can deploy an x509 certificate to each machine and use that to encrypt the keyring. See the configuration APIs for more details.

Publish from Visual Studio

  1. Create an ASP.NET 5 app. In this sample, I’ll create an MVC 6 app using the Web Site template under ASP.NET 5 Preview Templates.
  2. In Solution Explorer, right-click the project and select Publish.

  1. In the Publish Web dialog, on the Profile tab, select File System.

  1. Enter a profile name. Click Next.
  2. On the Connection tab, you can change the publishing target path from the default..\..\artifacts\bin\WebApp9\Release\Publish folder. Click Next.
  3. On the Settings tab, you can select the configuration, target DNX version, and publish options. Click Next.

The Preview tab shows you the publish path (by default, the same directory as the ”.sln” solution file).

Deploy to IIS server

  1. Navigate to the publish folder (..\..\artifacts\bin\WebApp9\Release\Publish folder in this sample).
  2. Copy the approot and wwwroot directories to the target IIS server. Note: MSDeploy is the recommended mechanism for deployment, but you can use Xcopy, Robocopy or another approach. For information on using Web Deploy see Publishing to IIS with Web Deploy using Visual Studio 2015.
  3. In IIS Manager, create a new web site and set the physical path to wwwroot. You can click onBrowse *.80(http) to see your deployed app in the browser. Note: The HTTP Platform Handler currently requires this work-around to support apps. If you get an HTTP error, see IIS server configuration.

IIS server configuration

  1. Enable the Web Server (IIS) server role. In client operating systems (Windows 7 through Windows 10) select Control Panel > Programs > Programs and Features > Turn Windows features on or off, and then select Internet Information Services.

  1. On the Role Services step, remove any items you don’t need. The defaults are shown below.

  1. Unlock the configuration section.

    • Launch IIS Manager and select the server in the Connections pane on the left (see image below).
    • Double-click Configuration Editor.
    • In the Section drop-down, select system.webServer/handlers, and then click Unlock Section.

  • Set the application pool to No Managed Code. ASP.NET 5 runs in a separate process and manages the runtime.

Supported operating systems

The following operations systems are supported:

  • Windows 7 and newer
  • Windows 2008 R2 and newer

Common errors

The following is not a complete list of errors. Should you encounter an error not listed here, please leave a detailed error message in the DISQUS section below along with the reason for the error and how you fixed it.

  • HTTP 500.19 : ** This configuration section cannot be used at this path.**

  • HTTP 500.19 : The requested page cannot be accessed because the related configuration data for the page is invalid.
  • The IIS 7.0 CoreWebEngine and W3SVC features must be installed to use the Microsoft HTTP Platform Handler 1.x.
  • HTTP 502.3 Bad Gateway
  • HTTP 500.21 Internal Server Error.

Additional Resources

时间: 2024-10-14 21:27:19

Publishing to IIS 发布到IIS的相关文章

本地MVC项目发布到IIS服务器

0瞎扯 朋友们有时候我们写个一个web程序只能使用卡西尼服务器调试,下面我教大家发布到IIS服务器上(包括本地ISS7.5和远程服务器 IIS) 1.VS发布 a.点击web项目->发布 b.在发布->配置文件->新建 连接中选择文件系统,并选择发布文件要存放的地址 设置->配置:如下 设置完成后点击发布 发布好的目录 b.配置IIS 0.创建网站之前必须启动:W3SVC(World Wide Web Publishing Service)服务,作用:通过 Internet 信息服

IIS发布站点Access数据库不能写

1..Net Framework 2.0中,共享池采用经典模式,在.Net Framework 2.0中,共享池采用集成模式. 2.在共享池高级设置中将"启用32位应用程序"属性值设置为true. 3.在数据库文件夹中,将IUSR_***权限设置为允许修改,写入.将数据库文件属性栏将"只读"前的"√"点掉即可. 4.在上传文件夹中,将IUSR_***权限设置为允许修改,写入. IIS发布站点Access数据库不能写,布布扣,bubuko.com

[转] ASP.NET WEB API程序在VS启动或发布到IIS后启动后发生 - Could not load file or assembly 'System.Web.Http.WebHost’异常,无法正常访问

Just do Copy Local = true in the properties for the assembly(System.Web.Http.WebHost) and then do a redeploy, it should work fine. http://stackoverflow.com/questions/20323107/could-not-load-file-or-assembly-system-web-http-webhost-after-published-to-

微信支付v3发布到iis时的证书问题

找了问题半天,调试没有问题,但是放到网站上就报错.最后解决方法. 一开始报“出现了内部错误” 解决方法是 方法一 var cer = new X509Certificate(certpath, password,X509KeyStorageFlags.MachineKeySet); 方法二 iis 找到部署的站点应用连接池,右键高级设置,找到“加载用户配置文件”改为true.window service2008 默认为false的. 解决后报另一个错误 基础连接已关闭 连接被意外关闭 其实是没访

如何将网页发布到IIs,并使用花生壳内网映射到外网。

今天做了一个网页,想发布到IIS上,结果提示未安装发布所需的扩展,Google了一下说是Vs安装有问题,要么重装要么修复,奈何时间不允许,本身网页也比较简单,一个Html页面+几个css和Js文件夹,索性在Vs里新建了一个网站,运行没问题后,打包发布网站. 而后在IIs管理器中添加网站 IIS怎么下载,怎么打开扩展功能,园子里很多了,不赘述,配置完成浏览看到正确页面,证明网站已经正式发布在IIS上了. 而后用花生壳添加对外网的映射. 内网Ip地址加IIs网站端口号映射到外网域名.(花生壳需要注册

IIS发布,无法显示CSS样式和图片

在BS的项目中,完成之后,都需要发布自己的网站.这个时候就要安装IIS了. 我也是最近才打算使用IIS来进行发布的.刚把IIS安装上,就遇到了问题. 出现问题就想办法解决问题呗.遇到的问题和视频里面的类似,他也讲了一下是如何解决的.不过,他的只是不显示图片.而我的是 图片和CSS样式都显示.错误的原因:路径与发布不一致. 检查了一下自己的代码,路径写错?这也不至于全写错吧. 打开自己发布前的vs程序,执行一下:没问题.如果是路径错了,在vs程序中检查,也应该不显示才对? 既然程序没问题,发布也没

Asp.Net Core 发布到IIS

一.Asp.Net Core 发布到IIS 1.许多时候在WindowsServer服务器上已经安装了IIS,监听80端口,那么Asp.Net Core应用的自宿主就没法监听80端口 2.也就是在Widnows系统已经启用IIS服务的情况下,需要安装 NET Core Windows Server Hosting,在目前官方给出的安装包中包含了.Net Core运行时 和Widnows Server  Hosting 3.Asp.Net Core发布到IIS下,需要.NET Core Windo

Delphi WebService 的编写、调试、发布(IIS)、调用

下面说明如何编写用于IIS发布的ISAPI类型的WebService.1. New|Other|WebServices|SOAP Server Application|这里先选择建立Web App Debugger    类型的WebService,因为这种类型的WebService便于调试,当我们调试好它,准备发布时再将    此类型转换为ISAPI类型.2. 选择Web App Debugger后,随便输入一个ClassName,这里我们输入“Test”3. 随后Delphi会询问你是否建立

将asp.net core站点发布到IIS上遇到的问题

今天第一次将整个 asp.net core 站点发布到 IIS 上,以前都是发布到 Linux 服务器上. 开始使用 dotnet publish -c release 命令发布,用浏览器访问站点时出现下面的错误: HTTP Error 502.5 - Process Failure Common causes of this issue: The application process failed to start The application process started but th