Reputation: 785
I created the aspnetdb.mdf tables and sp's inside my db on a remote hosting sql box.
Membership Provider is connecting remotely and working fine when I run it from my dev local box. But when I try it on the live site I get the error below.
Here are my web.config settings.
<add name="LocalSqlServer" connectionString="Data Source=remoteIP;Initial Catalog=admin_TeacherClassSchedule;User ID=developer;Password=blah" providerName="System.Data.SqlClient"/>
<membership defaultProvider="SqlProvider">
<providers>
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="LocalSqlServer"
applicationName="/" />
</providers>
Server Error in '/TCS' 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: Default Membership Provider could not be found.
Source Error:
Line 42: Line 43: Line 44: Line 45: Line 46:
Upvotes: 2
Views: 4333
Reputation: 785
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=1.1.1.1;Initial Catalog=dbname;User ID=blah;Password=blah" providerName="System.Data.SqlClient"/>
<membership defaultProvider="SqlProvider">
<providers>
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="SqlProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</profile>
<roleManager defaultProvider="SqlProvider" enabled="true" >
<providers>
<clear/>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
applicationName="/" />
</providers>
</roleManager>
Upvotes: 3
Reputation: 706
Try putting a <clear />
in front of your add on membership. I normally clear out all of my providers before I add them, just in case.
Upvotes: 1