Asp.Net.Core5 部署


IIS 安裝

控制面板  ->  程序  ->  啟動或關閉windows功能  ->  Internet Information Service (勾選所有選項)

                        

 

 

部署

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

必須安裝

 

 

 

 

 

 

 

點擊項目,選擇【發布】

 

 

 

 

點擊【發布】

 

 

腳本啟動

CMD運行腳本

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

 

 

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

添加網站-設置網站文件地址

程序池配置

運行效果

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM