日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

使.NET6在開(kāi)發(fā)時(shí)支持IIS_基礎(chǔ)應(yīng)用

作者:known ? 更新時(shí)間: 2022-03-10 編程語(yǔ)言

操作步驟

1.下載dotnet-hosting-6.0.0-rc.1.21452.15-win.exe并安裝,成功后檢查IIS模塊中是否有AspNetCoreModuleV2

2.安裝VS時(shí)選擇“開(kāi)發(fā)時(shí)IIS支持”

3.在IIS中創(chuàng)建站點(diǎn),目錄指向開(kāi)發(fā)項(xiàng)目wwwroot的上級(jí)目錄,應(yīng)用程序池默認(rèn)與站點(diǎn)名稱相同

4.將剛新建站點(diǎn)的應(yīng)用程序池的.NET CLR版本改成無(wú)托管代碼

5.在項(xiàng)目啟動(dòng)配置文件中添加配置(也可在項(xiàng)目屬性調(diào)試中配置)

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iis": {
      "applicationUrl": "http://xxx.xxxx.com",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS": {
      "commandName": "IIS",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

6.在項(xiàng)目中添加web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="bin\Debug\net6.0\Web.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" arguments="">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>

原文鏈接:https://www.cnblogs.com/known/p/9307647.html

欄目分類
最近更新