Using Membership and Roles in a Windows Form application

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
mobyscore
Posts: 17
Joined: Mon 28 May 2007 11:05

Using Membership and Roles in a Windows Form application

Post by mobyscore » Thu 18 Dec 2008 16:43

I have used Membership and Roles in web application for a while now and it is fine.

But I am now having problems trying to use Membership and Roles in a Windows Form application. Is this possible with dotConnect for MySQL?

I have done the following in VS 2008:

(1) Added a reference to "System.Web" to the Project
(2) Added Imports "System.Web.Security" to the VB code in the form
(3) Created an "app.config" and placed this in the top level Project folder

My App.Config looks like (hacked from my web.config):



























When I execute:

DotNETUser = System.Web.Security.Membership.CreateUser(UserName, Password, EmailAddress)

the stack trace is:

System.TypeLoadException was unhandled
Message="Could not load type 'Devart.Data.MySql.Web.Providers.MySqlMembershipProvider' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
Source="mscorlib"
TypeName="Devart.Data.MySql.Web.Providers.MySqlMembershipProvider"
StackTrace:
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, MembershipCreateStatus& status)
at System.Web.Security.Membership.CreateUser(String username, String password, String email)
at DBTransfer.Main.MoveTable(String[,]& AQTWebTableDef) in C:\OSS\Web site\DBTransfer\Main.vb:line 172
at DBTransfer.Main.cmdTransfer_Click(Object sender, EventArgs e) in C:\OSS\Web site\DBTransfer\Main.vb:line 110
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at DBTransfer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
InnerException:

Thanks for your help
------------------------

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 19 Dec 2008 10:10

Sorry, we do not support Membership and Roles in Windows Forms applications.

Post Reply