I have a fairly simple test right now and am comming across this error when ever I add a property of type 'Person' (Custom Class). I have a nother property of type Vendor that has no problem when I run the app with just this property. As soon as I add the Person Property I get the Error. One thing that I noticed is that ProfileProvider Intialize event gets triggered when I have the Person property and not when I have just the Vendor property. Any ideas would be appreciated.
<
profile defaultProvider="GlobalProfileProvider" enabled="true" >
<providers>
<add applicationName="ProfileProviderTest" name="GlobalProfileProvider" type="ProjectCentral.ProfileProvider.Profile" />
</providers>
<properties>
<add name="Person" type="ProjectCentral.Contacts.Person" />
<add name="Vendor" type="ProjectCentral.Vendors.Vendor" />
<add name="BGColor" type="string"/>
<add name="TEST" type="string" />
</properties>
</profile>
Test Page:
protected void Page_Load(object sender, EventArgs e)
{
Profile.Context.Remove("UserName");
Profile.Context.Add(
"UserName", "[email protected]");
Profile.Context.Add(
"vendorid", 162738);
Profile.Context.Add(
"vendorsearchdetail", Vendor_abs.eSearchDetail.Vendor_NameOnly);
}
Profile Provider:
public sealed class Profile :System.Web.Profile.ProfileProvider
{
#region
attributes
private string _AppName = "";
const string _Err_AppNameMissing = "ProfileProvider requires application name to be set prior to calling this function.";
const string _Err_UserNameMissing = "ProfileProvider requires user name in the context param.";
const string _Err_VendorIDMissing = "ProfileProvider requires a VendorID as part of the context when requesting a vendor.";
const string _Err_ConfigMissing = "ProfileProvider requires correct setting in configuration file.";
#endregion
public override string ApplicationName
{
get
{
return this._AppName;
}
set
{
this._AppName = value;
}
}
public override void Initialize(string name, NameValueCollection config)
{
if (config == null)
throw new ArgumentNullException("config");
this.ApplicationName = (string)config["applicationName"];
base.Initialize(name, config);
}
Santiago Perez
Systems Architect
Florida's Turnpike Enterprise