在windows IIS服务商配置asp.net core的服务器坏境,并部署

翻译自https://docs.microsoft.com/en-us/aspnet/core/publishing/iisc++

另外一篇参考的文章web

http://www.c-sharpcorner.com/uploadfile/2b481f/how-to-host-asp-net-web-api-on-iis-server/redis

支持的操做系统:windows

windows 7或更新api

windows server 2008 R2或更新服务器

IIS配置工具

使能Web server并配置相关选项网站

windows桌面版系统ui

windows server版操做系统spa

 

 安装.net core windows server托管工具包

1. 安装.NET Core Windows Server Hosting bundle: https://aka.ms/dotnetcore.2.0.0-windowshosting

  若是服务器没有链接互联网,应在安装hosting bundle前下载安装 microsoft visual c++ redistributable https://www.microsoft.com/download/details.aspx?id=53840

2. 从新启动系统或执行

    >net stop was /y

   >net start w3svc

 用visualstudio发布时安装Web Deploy

 若是你但愿在vs内用Web Deploy来部署你的应用,请在主机系统上安装最新版的Web Deploy。 

要安装Web Deploy,你能够使用Web Platform Installer(WebPI) https://www.microsoft.com/web/downloads/platform.aspx

或直接从微软下载中心下载 (https://www.microsoft.com/search/result.aspx?q=webdeploy&form=dlc)(注连接不能用)

应用配置

1. 使能IISIntegration component

  包含依赖项 Microsoft.AspNetCore.Server.IISIntegration

  Program.cs中加入一下代码

var host = new WebHostBuilder()
    .UseKestrel()
    .UseContentRoot(Directory.GetCurrentDirectory())
    .UseIISIntegration()
    .UseStartup<Startup>()
    .Build();

2. 配置IISOptions 

3. web.config

 

建立IIS网站

(注:此管理界面与windows7的IIS管理界面差别很大,在此配置失败,没有进行下去)

相关文章
相关标签/搜索