|
|
I apologize for breaking the link! Didn't realize I had. The files should be back up and working again. I had inadvertantly removed them so I had to reconvert hte code and the SQL, let me know if you find any errors. The link above now works again.
|
|
|
|
|
Have you tested the password recovery control with you code? This code causes an unhandled MembershipPasswordException that the passwordRecovery control doesn't catch. I've been investigating how to solve, but to no avail.
To recreate just plop a PasswordRecovery control and enter a username on first view, then enter a wrong answer and it will give an error.
Any help would be appreciated.
|
|
|
|
|
Disregard the prior post. I was running the website in debug mode and the debugger caught the exception before the passwordrecovery control did, so when you run it in release, the control acts normally.
|
|
|
|
|
|
Thanks for the convertion, but I get loads of errors, all about 'MySql...' isn't defined. Why is that?
|
|
|
|
|
You will need the MySQL Connector / NET for it to function properly. You can get it here:
MySQL Connector[^]
You can place the DLL into the bin/ folder of your application, or if using Visual Studio, Add it to your project (make sure you tell it to Copy) and it should work fine.
I am working on a large compiled web application at this point and used this code as a reference to write my own provider as I needed to match a specific Database Schema. If you've placed these in your App_Code folder but would like to have them pre-compiled, you may move them out of your App_Code folder and set them to Compile rather than Content within the Visual Studio IDE.
Thanks,
Dustin
|
|
|
|
|
I apologize for breaking the link! Didn't realize I had. The files should be back up and working again. I had inadvertantly removed them so I had to reconvert hte code and the SQL, let me know if you find any errors. The link above now works again.
|
|
|
|
|
Hello...
I want to creat a login session in my asp.net(vb) website and mysql database,but I do not know which is the best suitable way to do this,Do I use the bulit in login in asp.net or create my own session?
Can you explane in details?
Thank you..
|
|
|
|
|
Supposedly, there is an updated version of this at:
http://sprinj.com/ideas/view/5-a-mysql-membership-and-role-provider-for-aspnet-20
But the link to the source code seems to be broken. Does anyone know where I can find it?
|
|
|
|
|
I was wondering, like all people who do ... is there a vb version of this MySQL Membership and Role providers? I develop all my stuff in VB enviroment. I know I should go to C#, if I had a nickle for everytime I heard that. But anyways, I will give my first born to get ahold of that same code converted in vb. Well mabey not my first born, but If I have a second one I would consider it. Im on Yahoo messenger live on my phone as 'srbytes'.
Thanks guys,
Chris
|
|
|
|
|
An easy way to make your own VB set of these files is compile them into a class library, then use .NET Reflector to disassamble them into VB.
1. File>> New Project>> C# Class Library
2. Delete class1.cs
3. Add references to System.Web, System.Configuration, MySQL.Data
4. Add the 2 C# files from this download
5. Open up Lutz Reoder's .NET Reflector
5.1 Realizing you are a VB developer, you probably don't have this... so go download it.
6. Open up the assembly in the tool, change the output language to VB, drill down to the appropriate class, right click and choose dissasemble. The code will appear in the right. Scroll down and choose to expand methods. Voila, your very own VB copy of the code.
Other options: grow a set and move to C#.
|
|
|
|
|
Could you mind convert a VB version for me?
Thank you ver much!
|
|
|
|
|
Sorry!
could you mind tell me more detail about how to use Lutz Reoder's .NET Reflector?
|
|
|
|
|
please!!!
anybody can help me!
i ready cannot change it to vb version, and i don't where should place this code..
HELP! HELP!
|
|
|
|
|
Hi. Has anyone got the PasswordRecovery control to work with this membership provider? If I enter an incorrect answer to the password recovery question then I get an unhandled MembershipPasswordException. The provider code looks correct, exactly as shown in microsoft's sample... for some reason it looks like the PasswordRecovery control isn't handling the exception.
Any ideas?
Thanks.
|
|
|
|
|
did you ever figure out the fix for this(the password recovery control throwing an error)? I hit the same wall, and need a way out.
thanks,
Jose
|
|
|
|
|
Hi Jose,
I'm afraid the answer is 'no'. I eventually gave up on using the PasswordRecovery control and just implemented a solution using a Wizard control instead.
|
|
|
|
|
Hey I figured it out!! Since you're running it in debug, visual studio will always catch the exception. The PasswordRecovery is set up to catch it, but the visual studio gets it first. If you actually upload it to a site and run the program, the passwordrecovery control catches the exception and doesn't allow you to go forward.
Hope that helps,
Jose
|
|
|
|
|
I'm on a shared hosting account and I get this exception when trying to run a create account web control:
That assembly does not allow partially trusted callers
Does anyone know how to fix this?
Thanks,
Gabriel
|
|
|
|
|
You have to rebuild MySql.Data.dll assembly, go to E:\Program Files\MySQL\MySQL Connector Net 1.0.8\Source\MySqlClient or your MySqlClient path, open MySql.Data.2005.csproj and in the solution explorer open AssemblyInfo.cs and include next lines in the appropriate section:
using System.Security;
[assembly: AllowPartiallyTrustedCallers]
Build and add the new MySql.Data.dll generated to your project, Build and upload. It would be works fine.
|
|
|
|
|
i can make roles just fine but whne i hit the create uswer button i get this:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object[] parameters, Type[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
asd
|
|
|
|
|
Same for me. Anyone found an answer to this one yet? Is it a security problem? Is it a problem with the AD attributes?
John F. Holliday
|
|
|
|
|
Like everyone else, I had problems with even getting the security tab to open. After commenting out the trace messages, I was able to get everything to work. However, when I tried to add a user I was getting the error message when creating a user, but the error message really didn't help so I opened the MySqlMembershipProvider.cs file and added a try/catch block in the CreateUser Method to catch the error message and write it to a log file. The code I used is the following:
catch (Exception ex)<br />
{<br />
string fileName = "log.xml";<br />
System.IO.FileInfo inf = new System.IO.FileInfo(fileName);<br />
bool logFileExists = inf.Exists;<br />
<br />
DataSet ds = new DataSet("Errors");<br />
DataTable dt = new DataTable("Error");<br />
dt.Columns.Add("ErrorTime", Type.GetType("System.String"));<br />
dt.Columns.Add("ErrorInfo", Type.GetType("System.String"));<br />
dt.Columns.Add("ErrorContext", Type.GetType("System.String"));<br />
DataRow row = dt.NewRow();<br />
row["ErrorTime"] = DateTime.Now;<br />
row["ErrorInfo"] = ex.Message;<br />
row["ErrorContext"] = ex.ToString();<br />
dt.Rows.Add(row);<br />
ds.Tables.Add(dt);<br />
<br />
if (logFileExists)<br />
{<br />
DataSet existingLog = new DataSet();<br />
existingLog.ReadXml(fileName);<br />
ds.Merge(existingLog);<br />
}<br />
<br />
ds.WriteXml(fileName);<br />
<br />
status = MembershipCreateStatus.ProviderError;<br />
return null;<br />
}
Then, after the error occured I looked at the log.xml document and found the following:
You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.
I then searched for this error message and a post here[^] and changed the machineKey setting in my web.config file to the following:
<machineKey validationKey="21F0F891A36D12A278DB4FD8699C164EDBDA1FF9713A546C133CBE26DB026C5A5A10C884EF312DE5123959C8D96638423F8A6A3AE77F39E2B7A2596749B8C275"<br />
decryptionKey="D868653A8B663BD752B01277E0465C0788D5BB9A5A9A405E" <br />
validation="SHA1"/>
Once I did that, everything worked GREAT!
|
|
|
|
|
The Security tab was a challenge for me: VS 2005 / MySQL 4.1
Users table got created as follows "users" instead of "Users"
Renamed to uppercase U and it worked fine.
|
|
|
|