I am using membership and have created a custom profile that contains a property called FirstName. It works well except when the session/cookies are lost (I haven't figured out exactly which since it's pretty hard to reproduce). Then when I access any page of the site I get this exception:
[SettingsPropertyNotFoundException: The settings property 'FirstName' was not found.] System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +8757578 System.Configuration.SettingsBase.get_Item(String propertyName) +118 System.Web.Profile.ProfileBase.GetInternal(String propertyName) +49 System.Web.Profile.ProfileBase.get_Item(String propertyName) +129 WebFrontend.Security.SecurityHandler.get_FullName() +168 WebFrontend.Controls.LoginInfo.SetupLoginStatus() +15 System.Web.UI.Control.InitRecursive(Control namingContainer) +186 System.Web.UI.Control.InitRecursive(Control namingContainer) +421 System.Web.UI.Control.InitRecursive(Control namingContainer) +421 System.Web.UI.Control.InitRecursive(Control namingContainer) +421 System.Web.UI.Control.InitRecursive(Control namingContainer) +421 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2098
Do you have any idea how I can stop this exception from being thrown? Also CustomErrors are ON for this site and it bypasses the error page, instead it shows the exception. I just want to prevent the users from seeing this ugly exception.