Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6859601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:18:13+00:00 2026-05-27T02:18:13+00:00

I’ve a asp.net MVC app deployed to server it uses forms authentication and uses

  • 0

I’ve a asp.net MVC app deployed to server it uses forms authentication and uses CustomSqlMembership provider basically I’ve not changed anything in the SqlMembershipPRovider just copied the source from MS and included the source in my project and renamed it from time to time this error comes up.

This happens on localhost and remotely deployed system and I can’t figure out what could be the cause of it.

Server Error in ‘/’ Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Object reference not set to an instance of an object.

Source Error:

Line 50:                <clear/>
Line 51:                <!--<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="dq_systemConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/"/>-->
Line 52:         `<add name="CustomSqlMembershipProvider" type="AcmeCorp.CustomSqlMembershipProvider, AcmeCorp, Version=1.0.0.0, Culture=neutral" connectionStringName="AcmeCorpConnectionString" enablePasswordRetrieval="False" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="True" passwordFormat="Hashed" maxInvalidPasswordAttempts="6" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />`
Line 53:       </providers>
Line 54:        </membership>

this is the complete listing of membership object in web.config

<membership  defaultProvider="CustomSqlMembershipProvider">
        <providers>
            <clear />
            <!--<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="dq_systemConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />-->
<add name="CustomSqlMembershipProvider" type="AcmeCorp.CustomSqlMembershipProvider, AcmeCorp, Version=1.0.0.0, Culture=neutral" connectionStringName="dq_systemConnectionString" enablePasswordRetrieval="False" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="True" passwordFormat="Hashed" maxInvalidPasswordAttempts="6" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />

public class CustomSqlMembershipProvider : AcmeCorp.SqlMembershipProvider
  {
    static public ConnectionStringSettings css {get; set;}

    public override void Initialize(string name, NameValueCollection config)
    {
      config.Add("connectionString", css.ConnectionString);
      base.Initialize(name, config);
    }
  }

  public class CustomSqlRoleProvider : AcmeCorp.SqlRoleProvider
  {
    static public ConnectionStringSettings css { get; set; }


    public override string GetConnectionString()
    {
      return css.ConnectionString;
    }

    public override void Initialize(string name, NameValueCollection config)
    {
      //config.Add("connectionString", css.ConnectionString);
      base.Initialize(name, config);
    }
  }



  public interface ISiteProvider
  {
    bool Initialise(string host);
    Site GetCurrentSite();
  }

  public class SiteProvider : ISiteProvider
  {
    SystemMetaDataContext mDB;
    Site mSite;
    public SiteProvider(SystemMetaDataContext db)
    {
      mDB = db;
    }

    public bool Initialise(string host)
    {
      mSite = mDB.Sites.SingleOrDefault(s => s.Host == host);
      if (null != mSite)
      {
        CustomSqlMembershipProvider.css = new ConnectionStringSettings();
        CustomSqlMembershipProvider.css.ConnectionString = mSite.Connection;
        CustomSqlMembershipProvider.css.ProviderName = "System.Data.SqlClient";
        CustomSqlMembershipProvider.css.Name = "dq_systemConnectionString";
        CustomSqlMembershipProvider.css.ConnectionString = mSite.Connection;

        CustomSqlRoleProvider.css = new ConnectionStringSettings();
        CustomSqlRoleProvider.css.ConnectionString = mSite.Connection;
        CustomSqlRoleProvider.css.ProviderName = "System.Data.SqlClient";
        CustomSqlRoleProvider.css.Name = "dq_systemConnectionString";
        CustomSqlRoleProvider.css.ConnectionString = mSite.Connection;


        return true;
      }
      else
      {
        return false;
      }
    }

    public Site GetCurrentSite()
    {
      return mSite;
    }
  }  



 public class BaseController : Controller



 {
    ISiteProvider mSiteProvider;
    protected IRepository mRepository { get; private set; }
    protected int DefaultPageSize { get; set; }

    public BaseController()
    {
      DefaultPageSize = 10;
      mSiteProvider = new SiteProvider(new SystemMetaDataContext());  
    }

    public BaseController(IDQRepository repository)
    {
      mRepository = repository;
      DefaultPageSize = 10;
      if (Session["ActiveView"] == null)
      {
        IList<RoleViewModel> roles = mRepository.GetAllRoles();
        foreach (RoleViewModel rvm in roles)
        { 
          if (Roles.IsUserInRole(rvm.Name))
          {
            Session["ActiveView"] = rvm.Name;
            break;
          }
        }
      }
    }

     protected override void Initialize(RequestContext requestContext) 
     {
      string[] host = requestContext.HttpContext.Request.Headers["Host"].Split(':');
      MetaInfo.PopulateMeta(host[0]);
      if (!mSiteProvider.Initialise(host[0]))
        RedirectToRoute("Default");

      if (null == mRepository)
        mRepository = new DQRepository();

      base.Initialize(requestContext);  
     }  

     protected override void OnActionExecuting(ActionExecutingContext filterContext) 
     {
       ViewData["Site"] = Site;   
       base.OnActionExecuting(filterContext);  
     }  

     public Site Site {  
        get {  
            return mSiteProvider.GetCurrentSite();  
        }  
     }  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:18:13+00:00Added an answer on May 27, 2026 at 2:18 am

    Where is initialized this static variable ?

     static public ConnectionStringSettings css {get; set;}
    

    Static variables are not thread safe.
    You must initialize them in a thread safe way, especially if running in web farm mode.

    If the server uses an application pool with more than 1 processor set in its config, it is running in web farm mode. In web farm mode, you will have 2 web applications running, but your static variable will be created only once as this memory space is shared (in fact there is more than that but you can write books on this subject).

    You can disable web farm mode by setting the processor count to 1 in the application pool.

    Where is the code initializing this css variable ?
    Could you write it here ?
    From where is it called ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.