zoukankan      html  css  js  c++  java
  • 在windows IIS服务商配置asp.net core的服务器坏境,并部署

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

    另一篇参考的文章

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

    支持的操作系统:

    windows 7或更新

    windows server 2008 R2或更新

    IIS配置

    使能Web server并配置相关选项

    windows桌面版系统

    windows server版操作系统

     安装.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管理界面差异很大,在此配置失败,没有进行下去)

  • 相关阅读:
    12.12 怀北滑雪场滑雪记
    datetime类型offset-aware与offset-navie
    Django-models中的choise
    什么是__name__()
    单机Ubuntu安装第二个Mysql服务
    Ubuntu下的Python安装
    设置mysql允许外网访问
    Ubuntu初次设置root密码
    使用VMware+Ubuntu,无法切换大小写的异常处理
    XShell/Xftp 无法连接 Ubuntu20
  • 原文地址:https://www.cnblogs.com/ccjungle/p/7509070.html
Copyright © 2011-2022 走看看