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