C# 尚未定义配置文件组“ProfileGroupPersonal”
我需要在MVC中实现成员身份验证。我还使用配置文件组手动创建了ProfileCommon。现在,我在创建用户时遇到以下错误: 错误:尚未定义配置文件组“ProfileGroupPersonal” 这是我的ProfileCommon.cs代码C# 尚未定义配置文件组“ProfileGroupPersonal”,c#,asp.net,asp.net-mvc,asp.net-membership,forms-authentication,C#,Asp.net,Asp.net Mvc,Asp.net Membership,Forms Authentication,我需要在MVC中实现成员身份验证。我还使用配置文件组手动创建了ProfileCommon。现在,我在创建用户时遇到以下错误: 错误:尚未定义配置文件组“ProfileGroupPersonal” 这是我的ProfileCommon.cs代码 public class ProfileGroupPersonal : System.Web.Profile.ProfileGroupBase { public virtual string UserName { get
public class ProfileGroupPersonal : System.Web.Profile.ProfileGroupBase
{
public virtual string UserName
{
get
{
return ((string)(this.GetPropertyValue("UserName")));
}
set
{
this.SetPropertyValue("UserName", value);
}
}
}
public class ProfileCommon : System.Web.Profile.ProfileBase
{
public virtual ProfileGroupPersonal Personal
{
get
{
return ((ProfileGroupPersonal)(this.GetProfileGroup("Personal")));
}
}
public virtual ProfileCommon GetProfile(string username)
{
return Create(username) as ProfileCommon;
}
}
ProfileCommon p = new ProfileCommon();
ProfileCommon profile = p.GetProfile(userName);
profile.Personal.UserName = userName;
My web.config代码:
<profile inherits="FormAuthentication.Models.ProfileCommon" >
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="Test"/>
</providers>
</profile>