我有一個.NET core 3.1 razor pages網站。我正在使用 Windows 憑據(帶有 Active Directory)進行身份驗證,并且正在使用策略管理授權。使用 IIS express(開發時使用的那個可以正常作業。顯示我的用戶名)
現在我使用 IIS 管理器使用我的機器 IP 來托管這個站點,例如“xxx.xxx.xxx.xxx:portNumber”。如果啟用匿名身份驗證,則正在加載,但如果我包含 Windows 憑據,則會失敗。我按照這里的指南-> 
當我嘗試訪問該網站時,它會拋出 錯誤 HTTP 500.19 - 內部服務器錯誤
模塊:WindowsAuthenticationModule
通知:AuthenticateRequest
配置來源
<anonymousAuthentication enabled="false" />
**<windowsAuthentication enabled="true" />** --> *this line is in red*
</authentication>
在這里,我更改了applicationhost.config檔案中的幾行。
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />
我將兩行都從Deny更改為Allow。重新啟動,但它不起作用。
我也激活了一些 Windows 功能,如下所示

uj5u.com熱心網友回復:
我終于解決了。我參考了這篇文章This configuration section cannot be used at this path - Windows 2016
我在位于的檔案中設定了以下條目
C:\Windows\System32\inetsrv\config\applicationHost.config
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />
<section name="ipSecurity" overrideModeDefault="Allow" />
我錯誤地編輯了applicationHost.config位于IISExpress我的檔案檔案夾中的檔案。這就是為什么這不起作用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/478031.html
