More in this section
Forums / Bugs & Issues / Error "Object reference not set to an instance of an object" in .../sitefinity/Administration/Users

Error "Object reference not set to an instance of an object" in .../sitefinity/Administration/Users

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Vik
    Vik avatar
    2 posts
    Registered:
    17 Aug 2010
    26 Jan 2011
    Link to this post
    Hello. I get the problem:
    Environment:
    1. SiteFinity 4 01033Sitefinity_4.0.1110.0-Developers-Only
    2. FireFox 4.0b10pre (2011-01-25)
    3. Win 7 64bit

    How to:
    1. Implemented custom
    public class DummyRoleProviderSF4:RoleDataProvider
    and
    public
     class DummyMembershipProviderSf4:MembershipDataProvider
    2. Registered providers in SF4
    3. login in http://localhost:60876/sitefinity/Administration/Users
    4. Got the problem and error message "Object reference not set to an instance of an object"

    Question: How can i get more detailed analysis about this problem ?

    Thank you.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Feb 2011
    Link to this post
    Hello Vik,

    Can you check the HTTP request and HTTP response when you get the error?  I am sending you a sample implementation for Membership provider that works fine at my end

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Telerik.Sitefinity.Security.Data;
    using Telerik.Sitefinity.Security.Model;
    using Telerik.Sitefinity.Security;
     
    namespace Telerik.Sitefinity.Samples
    {
       public class MembershipDataProviderCustom : MembershipDataProvider
        {
            public override Security.Model.User CreateUser(string userName)
            {
               //
                return null;
            }
     
            public override Security.Model.User CreateUser(Guid id, string userName)
            {
                //
                return null;
            }
     
            public override Security.Model.User GetUser(Guid id)
            {
               //
                return null;
            }
     
            public override IQueryable<Security.Model.User> GetUsers()
            {
              //
                List<User> list = new List<User>(1) ;
                var manager = UserManager.GetManager();
                var q = manager.GetUsers().Where(us => us.UserName == "test1").SingleOrDefault();
                if (q == null)
                {
                    var u = manager.CreateUser("test1");
                   manager.SaveChanges();
                    list.Add(u);
                    return list.AsQueryable<User>();
                }
               list.Add(q);
               return list.AsQueryable<User>();
            }
     
            public override void Delete(Security.Model.User item)
            {
               //
            }
        }
    }



    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered