Parser Error when using custom membership provider

Parser Error when using custom membership provider

Old forum URL: forums.lhotka.net/forums/t/1821.aspx


f.scherer posted on Thursday, November 23, 2006

Hi,

i am not sure if this is the right place to ask but i will do it anyway. I have i problem when i want to use a custom membership provider as described in the csla book.

Since two days i have vista rtm installed and i debug the web application using the iis 7 which comes with vista. I use the new ajax beta 2 framework in the application.

The problem is, that after i added all the stuff i need for using custom membership to my web.config, i get the following error when compiling.

Server Error in '/myapp' 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: The specified connectionStringName, 'LocalSqlServer', was not registered.

Source Error:

Line 352:                <providers>
Line 353:                    <add connectionStringName="LocalSqlServer"
Line 354:                        name="AspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 355:                </providers>
Line 356:

Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config    Line: 354


Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET Version:2.0.50727.312

 

How can i get rid of this error message.

This is what i entered in my web.config:

<membership defaultProvider="HAMembershipProvider">

<providers>

<add name="HAMembershipProvider" type="HAMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" description="Stores and retrieves membership data using Csla business objects."/>

</providers>

</membership>

Thanks for your help in advance,

 

Frank.

Bayu replied on Thursday, November 23, 2006

Funny.

You mention an addition in one part of the config, while the exception is about another part.

The error is about your connection string name 'LocalSqlServer'.  Apparently you make use of named connection (or at least, that's what you specify in the config). If would start debugging on this part, is this name actually registered? Apparently VS is unable to recover it.

If the config worked fine before, and only started throwing exception after addition of the custom membership provider then perhaps there was no need to verify this LocalSqlServer earlier. And your addition of the custom membership provider just caused VS to drill down to the part of the config that refers to this named connection and therefore you suddenly recieve the error.

Good luck debugging. ;-)

Bayu

Copyright (c) Marimer LLC