I'm getting the same error when I try to cast the context.user.identity object to a SiteIdentity object in the siteheader.ascx user control. The line that causes the issue is
Dim id As SiteIdentity = CType(Context.User.Identity(), SiteIdentity)
Below is the stack trace. If anyone knows how to resolve this a solution would be greatly appreciated. In the mean time I'll keep banging my head on the keyboard.
[InvalidCastException: Specified cast is not valid.]
home.Opydcom.Web.Controls.User.SiteHeader.Page_Loa d(Object sender, EventArgs e) in C:\Inetpub\web\opyd\wwwroot2\html\home\Controls\Us er\SiteHeader.ascx.
vb:57
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +725