membership.createuser error - Specified method is not supported

Last post 08-17-2009 7:13 PM by weitzhandler. 11 replies.

Sort Posts:

  • membership.createuser error - Specified method is not supported

    11-12-2008, 2:57 PM
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79

    Hi All,

    I have 2 database. one is the comp employee database and the other is the aspnetdb (generated by aspnet_regsql). The website uses the aspnetdb database to login to the website. initally i imported data from employee database to aspnetdb database by the membership.create(username,password) by creating a c# file in the website say import data and it works fine on click of a button. Now i tried to do the data import in a windows services.every 1 min the data will check for any new employees from the employee database and then should create that user data into the aspnetdb database. When i try to use the membership.createuser i get an error as specified method is not supported. I hve not worked on this before and would like to know is if membership.createduser can be done only over the web and doesnot support in the windows services. I tried most of the ways i know but i am in blocked.Let me know if anything else can be done in this issue. Thanks for your time and support.

    spb

  • Re: membership.createuser error - Specified method is not supported

    11-16-2008, 11:58 PM

    Hi spbtech,

    Basically, Membership is designed for web applications. It couldn't be used it in a windows application. You have to write the logic by yourself.

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: membership.createuser error - Specified method is not supported

    11-17-2008, 2:22 PM
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79
    Hi Thanks for your response. May I please know if any sample code or tutorials are available for this issue? I tried in Google but unable to find it. Any sought of info would be of great helpThanksspbtech 

     

  • Re: membership.createuser error - Specified method is not supported

    11-17-2008, 9:56 PM

    Thanks for your followup spbtech.

    I'm afraid there's no exact sample code can be found. But it's not complex. Please try it by yourself.

    • Create required tables in database such as Users and Roles tables. 
    • Use ADO.NET to store and retrieve the user information for creating and authenticating a user.

    Best regards.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: membership.createuser error - Specified method is not supported

    11-18-2008, 12:52 PM
    Answer
    • All-Star
      16,956 point All-Star
    • guru_sarkar
    • Member since 08-30-2007, 8:00 PM
    • Posts 2,557

    here is an article which uses Membership with WinForms: http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

    See if that points you something.....

  • Re: membership.createuser error - Specified method is not supported

    12-01-2008, 1:29 PM
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79

     

    Hi, 

    Thanks fro your reply. It was really helpful to understand.  I was by that time into the other priority developments and now turned back to work on but do have a few queries. I tried to use the code in the app.config,  but my application (which is a  windows service application when I install and start the services it stops automatically) does not allow me start the services. When I remove the added code from the app.config it works fine. Let me know if anything else has to be done.

     

    Thanks

     

    Spbtech.

     

    The following code in app.config is as below .. I hve just added to the existing app.config file.

     

    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

    <appSettings>

    <add key="Credentials.otherdatasource" value="theservername" />

    <add key="Credentials.otherusername" value="xyz" />

    <add key="Credentials.otherpasswordsead" value= "givenpassword" />

    <add key="filename.WaitIntervalSeconds" value="60" />

    <add key="ImageProcessor.HostName" value="localhost" />

    <add key="ImageProcessor.Port" value="port address" />

    <add key="ClientSettingsProvider.ServiceUri" value="" />

    </appSettings><system.web>

     

    <membership defaultProvider="ClientAuthenticationMembershipProvider">

    <providers>

    <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=some value" serviceUri="" />

    </providers>

    </membership>

    <roleManager defaultProvider="ClientRoleProvider" enabled="true">

    <providers>

    <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=somevalue" serviceUri="" cacheTimeout="86400" />

    </providers>

    </roleManager>

    <!--code added from the link you provided.-->

    <membership >

    <providers>

    <remove name="AspNetSqlMembershipProvider"/>

    <add name="AspNetSqlMembershipProvider"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

    connectionStringName="LocalSqlServer"

    enablePasswordRetrieval="false"

    enablePasswordReset="true"

    requiresQuestionAndAnswer="false"

    applicationName="/"

    requiresUniqueEmail="false"

    passwordFormat="Hashed"

    maxInvalidPasswordAttempts="5"

    minRequiredPasswordLength="1"

    minRequiredNonalphanumericCharacters="0"

    passwordAttemptWindow="10"

    passwordStrengthRegularExpression="" />

    </providers>

    </membership>

    <!--code ended from the link.-->

    </system.web>

    </configuration>

  • Re: membership.createuser error - Specified method is not supported

    12-11-2008, 6:49 PM
    Answer
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79

    Hi

    Just thought to share out. Changed the applicationName inside the provider to my applicationName and it worked like a charm.

    Thanks for the support

  • Re: membership.createuser error - Specified method is not supported

    08-13-2009, 12:27 AM
    • Member
      175 point Member
    • weitzhandler
    • Member since 10-27-2007, 2:25 PM
    • Jerusalem
    • Posts 135

     

    Can you please show me an example, I encounter the same issue, i changed te application name and still have problems.

    Shimmy
  • Re: membership.createuser error - Specified method is not supported

    08-13-2009, 7:18 PM
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79

     Hi,

    Let me explain my requirment and the solution for that requirment.  I had a database that holds the employee details.

    I developed a website to use this DB. Now instead of allowing the employees to create there own login and password, i developed a window services to create a unique login and password for all employees. say username would be there name+dept no and the password would be the first 4 letters of the name + the employee number +deptNo.

    The problem:- Membership.CreateUser was not accepted in the windows services. ( My thought was wrong until i figured it out)

    The solution:- In the  APP.Config file ,under Connectionstring-- establish the connection string.

    In <membership> & <provider> add the prop. that is used in the membership.createusers wizard.

    The application name is the name  from the aspnet_applications table of aspnetdb.

    and when you use the membership.createuser in the windows applicaiton you will see that the members are created in the aspnet_membership table with the prop. that you have mentioned in the app.config file

    Hope this helps

     

  • Re: membership.createuser error - Specified method is not supported

    08-13-2009, 9:45 PM
    • Member
      175 point Member
    • weitzhandler
    • Member since 10-27-2007, 2:25 PM
    • Jerusalem
    • Posts 135

    Hello and thanks for your response!

    Let me explain you what I am trying to achieve.
    I want to use a custom MembershipProvider that implements System.Web.Security.MembershipProvider.

    When I call the CreateUser method from within the website it works like a charm, the problem is that when I call Membership.CreateUser from the win-app, it doesn't even reach the method, instead I am getting a NotSupportedException telling me 'Specified method is not supported.'.

    I even tried replacing the content of the CreateUser with throwing some exception but I don't see that exception when calling the method from the win-app, instead I am getting the NotSupportedException.

    Note, that the ValidateUser method does work from the win-app, weird no?
    I also tried GetAllUsers() which also throws the NotSupportedException as above.

    Any further discussion will be really appreciated!

    Shimmy
  • Re: membership.createuser error - Specified method is not supported

    08-17-2009, 4:15 PM
    • Member
      236 point Member
    • spbtech
    • Member since 09-09-2008, 7:16 PM
    • Posts 79

    sorry for the late reply. was on vacation.

    First Create the database with pre-requested values..

    i created the aspnetdb by using the regsrvr and created the main pre requested data such as the name of the application and  the application id etc.,

    In the windows Applicaiton, the app.config file can hold the membership details.

    i have used the following

    <membership defaultProvider="AspNetSqlProvider">
          <providers>
            <clear/>
         
    <!--The createuser wizard properties and i am declaring a few of them in the provider as below-->

    <add name="ProvidersNAME say (ABCCOMPANY)" type="System.Web.Security.SqlMembershipProvider"
         connectionStringName="The connection String that has been given in the Configuration section say(mycompConn)"
         enablePasswordRetrieval="false"
         enablePasswordReset="True"
         passwordFormat="Hashed"
         requiresQuestionAndAnswer="false"
         applicationName="This is the Value that exist in the database ie.(in the AspnetDb.aspnet_application.applicationname -- say i have something like salesDeptApplication)"
         requiresUniqueEmail="False"
         maxInvalidPasswordAttempts="7"
         passwordAttemptWindow="10"
         minRequiredNonalphanumericCharacters="0" />
    </provideres>
    </membershigp>

    In the Creating of the user .CS file i have added the follwing.


    ProviderSettings sampleprovider1 = new ProviderSettings("ABCCOMPANY", "System.Web.Security.SqlMembershipProvider");

    MembershipCreateStatus thestatus = new MembershipCreateStatus();

                         
    Membership.Providers["ABCCOMPANY"].CreateUser(The_username, the_pwd, the_emailaddress, null, null, true, null, out thestatus);

    this will create the user in the aspnet_membership table with the username and password from the windows application

    hope this helps.

     

  • Re: membership.createuser error - Specified method is not supported

    08-17-2009, 7:13 PM
    • Member
      175 point Member
    • weitzhandler
    • Member since 10-27-2007, 2:25 PM
    • Jerusalem
    • Posts 135

     

    No.

     

    I said I am using a custom membershipprovider that is called MyMembershiProvider that inherits from System.Web.Security.MembershipProvider.

    when I call Membership.ValidateUser it does go to my ms provoder, but in other methods (like CreateUser) I get exception.

     

    Thanks for you response anyway.

    Shimmy
Page 1 of 1 (12 items)