2017年2月13日 星期一

[MVC]出現HTTP Error 401.0 - Unauthorized

使用預設樣板建立MVC5,Identity來做驗證,如Action有使用Authorize會出現

HTTP Error 401.0 - Unauthorized


如沒使用Identity,在web.config

<system.webServer>
    <modules>
       <remove name="FormsAuthentication" /> //將這行移除即可
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

Visual Studio JS intellisense 失效解決方式

  試了好久,發現到工具>選項>IntelliCode js項目設定啟用,重新開啟VS就正常了! 後來發現是TypeScript3.2版有問題停用,使用4.3版的TypeScript即可