I'm using the ASP.NET Membership provider to handle all membership activities on my current site.
I've run into a weird problem. As you know, if you are familiar with Asp.Net membership, the data is stored in ProfileCommon.
So you could do ProfileCommon.UserId to get the userID.
This all works fine on my production server, my staging server and for old accounts on my local dev server.
However, if I create a new user on my local dev server, the Profilecommon object is not being populated and it is throwing errors because pages reference ProfileCommon.UserId for instance and it's null, thus throwing an exception. The user is Authenticated, but ProfileCommon is not being populated.
Does anyone have any ideas/suggestions as to why this might be happening?
Edit: here's my web.config entry. I'm not sure why we remove AspnetSqlProfileProvider then add it. This is a site I took over and I'm not 100% familiar with asp.net membership yet.
<profile defaultProvider="AspNetSqlProfileProvider">
<providers>
<remove name="AspNetSqlProfileProvider"/>
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConnectionString"/>
</providers>
Actual profile info;
<profile defaultProvider="SqlProfileProvider">
<providers>
<remove name="AspNetSqlProfileProvider"/>
<add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="FiftyMillionDBConnection"/>
</providers>
<properties>
<add name="FirstName" type="String" serializeAs="String"/>
<add name="LastName" type="String" serializeAs="String"/>
<add name="EmailAddress" type="String" serializeAs="String"/>
<add name="ScreenName" type="String" serializeAs="String"/>
<add name="BirthDay" type="DateTime" serializeAs="String"/>
<group name="Address">
<add name="AddressLine1" type="String" serializeAs="String"/>
<add name="AddressLine2" type="String" serializeAs="String"/>
<add name="City" type="String" serializeAs="String"/>
<add name="State" type="String" serializeAs="String"/>
<add name="Zip" type="String" serializeAs="String"/>
</group>
<group name="PersonalInfo">
<add name="Gender" type="String" serializeAs="String"/>
<add name="Height" type="String" serializeAs="String"/>
</group>
<group name="OtherInfo">
<add name="Agent" type="String" serializeAs="String"/>
<add name="Employee" type="String" serializeAs="String"/>
<add name="Source" type="String" serializeAs="String"/>
<add name="EventRegistration" type="String" serializeAs="String"/>
</group>
<group name="AuthInfo">
<add name="GUID" type="String" serializeAs="String"/>
<add name="RegSource" type="String" serializeAs="String"/>
<add name="ReceiveMail" type="String" serializeAs="String"/>
</group>
</properties>
</profile>
Thank you!