今天在编写代码是:无法将类型为“System.Security.Principal.WindowsIdentity”的对象强制转换为类型“System.Web.Security.FormsIdentity”。

关于<authentication mode="Forms" />
    

System.Security 无法将类型为“System.Security.Principal.WindowsIdentity”的对象强制转换为类型“System.Web.Security.FormsIdentity”。

解决办法如下:

 

 <authentication mode="Windows"/> 
  <!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
            开发人员通过该节可以配置
            要显示的 html 错误页
            以代替错误堆栈跟踪。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->

注意红色字体:

改为: <authentication mode="Forms"/>

今天在编写代码是:无法将类型为“System.Security.Principal.WindowsIdentity”的对象强制转换为类型“System.Web.Security.FormsIdentity”。

关于<authentication mode="Forms" />
    

System.Security 无法将类型为“System.Security.Principal.WindowsIdentity”的对象强制转换为类型“System.Web.Security.FormsIdentity”。

解决办法如下:

 

 <authentication mode="Windows"/> 
  <!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
            开发人员通过该节可以配置
            要显示的 html 错误页
            以代替错误堆栈跟踪。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->

注意红色字体:

改为: <authentication mode="Forms"/>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-06-22
  • 2021-11-30
  • 2021-07-02
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2021-08-04
  • 2022-12-23
  • 2022-01-22
  • 2021-04-15
  • 2021-06-28
  • 2022-12-23
相关资源
相似解决方案