Brug for hjælp med MySql Connector 5.2.2 Profile Provider
Er der nogen som har fået denne til at virke?Hvis nogen kunne give en trin-for-trin guide ville det være fedt.
Jeg har prøvet flg:
Tilføjede til min web config:
<connectionStrings>
<remove name="LocalMySqlServer"/>
<add name="LocalMySqlServer" connectionString="Data Source=localhost;Database=test;Username=root;Password=xxx;"/>
</connectionStrings>
...
<roleManager defaultProvider="MySQLRoleProvider"/>
<membership defaultProvider="MySQLMembershipProvider"/>
<profile defaultProvider="MySQLProfileProvider">
<properties>
<add name="Name" type="string" allowAnonymous="true"/>
</properties>
</profile>
Tilføjede en reference til både MySql.Data dll og MySql.Web dll.
Min Default.aspx codebehind:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
TextBox1.Text = this.Profile.Name;
}
protected void Button1_Click(object sender, EventArgs e)
{
this.Profile.Name = TextBox1.Text;
}
Fejlmeddelse:
System.Configuration.ConfigurationErrorsException was unhandled by user code
Message="There was an error during profile provider initilization. (C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Config\\machine.config line 151)"
Source="System.Web"
BareMessage="There was an error during profile provider initilization."
Filename="C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Config\\machine.config"
Line=151
StackTrace:
ved System.Web.Profile.ProfileBase.InitializeStatic()
ved System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated)
ved System.Web.HttpContext.get_Profile()
ved _Default.get_Profile() i c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website2\0e2bc8f4\90dc94b6\App_Web_pf4pwsro.0.cs:linje 0
ved _Default.Page_Load(Object sender, EventArgs e) i c:\Users\Jens\Documents\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs:linje 16
ved System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
ved System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
ved System.Web.UI.Control.OnLoad(EventArgs e)
ved System.Web.UI.Control.LoadRecursive()
ved System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)