An error occurred while forcibly converting an object of the type "System. Security. Principal. GenericIdentity" to the type "System. Web. Security. FormsIdentity ".

Source: Internet
Author: User

After Windows 7 is installed, the original project is also migrated from IIS7 in Win03 to IIS7 in Windows 7. Because IIS7 is used for the first time, the following error occurs when you access the site after configuring the project:

 

"/" Indicates a server error in the application. The object of the type "System. Security. Principal. GenericIdentity" cannot be forcibly converted to the type "System. Web. Security. FormsIdentity ".

Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details:System. InvalidCastException: the object of the type "System. Security. Principal. GenericIdentity" cannot be forcibly converted to the type "System. Web. Security. FormsIdentity ".

Source error:

Row 90: // If (! Webappconfig. enablesso) Row 91: // {row 92: formsidentity id = (formsidentity) user. identity; row 93: formsauthenticationticket ticket = ID. ticket; row 94: String userdata = httputility. urldecode (ticket. userdata );

 

Baidu, google, bing, and soso on the Internet for a long time. If no solution was found, I was puzzled. Why did the good system run on IIS6 fail to be satisfied when I got to IIS7, later, I accidentally adjusted the managed pipeline mode related to the application pool, and changed the default integration to the classic model. The system finally got back to normal.

This article will not go into details about the integration of managed pipeline mode and the distinction between Classic mode, see another blog of Blog: http://www.cnblogs.com/clc2008/archive/2011/08/02/2125607.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.