Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 尚未定义配置文件组“ProfileGroupPersonal”_C#_Asp.net_Asp.net Mvc_Asp.net Membership_Forms Authentication - Fatal编程技术网

C# 尚未定义配置文件组“ProfileGroupPersonal”

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

我需要在MVC中实现成员身份验证。我还使用配置文件组手动创建了ProfileCommon。现在,我在创建用户时遇到以下错误:

错误:尚未定义配置文件组“ProfileGroupPersonal”

这是我的ProfileCommon.cs代码

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>