測試ASP.NET MVC 3 Intranet Application Project,使用IE連上IIS Express檢視專案網站時出現以下錯誤:

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

這是IIS Express未開啟Windows身分驗證功能導致。

方法一,透過VS2010的專案屬性視窗:

方法二,如果想一勞永逸啟用所有IIS Express執行網站的Windows身分驗證,可修改\Documents\IISExpress\config\applicationhost.config,找到<windowsAuthentication enabled="false" />,只需將false改為true,就OK囉!


Comments

Be the first to post a comment

Post a comment