IIS 安装

控制面板  ->  程序  ->  启动或关闭windows功能  ->  Internet Information Service (勾选所有选项)

                        

asp.net五层架构 asp.net core 5_microsoft

 

 

部署

下载地址:https://dotnet.microsoft.com/download/dotnet/5.0

必须安装

 

 

asp.net五层架构 asp.net core 5_IIS_02

 

 

 

asp.net五层架构 asp.net core 5_microsoft_03

 

 

点击项目,选择【发布】

asp.net五层架构 asp.net core 5_IIS_04

 

asp.net五层架构 asp.net core 5_microsoft_05

 

 

asp.net五层架构 asp.net core 5_asp.net五层架构_06

 

点击【发布】

asp.net五层架构 asp.net core 5_microsoft_07

 

 

脚本启动

CMD运行脚本

D:\DemoCode\DemoPublic>dotnet AspNetCore5Demo.dll --urls="http://localhost:66"

 

asp.net五层架构 asp.net core 5_microsoft_08

 

IIS启动

 

注意web.config配置

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
    <location  path="." inheritInChildApplications="false">
        <system.webServer>
            <handlers>
                <!--<remove name="aspNetCore"/>-->
                <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified"/>
            </handlers>
            <aspNetCore processPath="dotnet" arguments=".\AspNetCore5Demo.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"
                     hostingModel="inprocess"/>
        </system.webServer>
    </location>
</configuration>

主意IIS中模块,是否存在,安装dotnet-hosting

asp.net五层架构 asp.net core 5_IIS_09

添加网站-设置网站文件地址

asp.net五层架构 asp.net core 5_microsoft_10

程序池配置

asp.net五层架构 asp.net core 5_microsoft_11

运行效果

asp.net五层架构 asp.net core 5_asp.net五层架构_12