In my web config I have 2 membership providers defined, one for sql, one for active directory. My thought process was that on a release build, I set AD as the default, but while debugging I use sql. This is because my dev computer does not have access to the domain to authenticate users.
It seems to me however that my web site tries to connect to both sources instead of just the default provider. So while I have an active directory provider defined, I cannot do development because it fails to connect, even though sql is defined as default.
Is there a way to only connect to the default provider?
My currently broken web config is like so:
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SqlServer" />
<add name="ActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ActiveDirectoryServer" attributeMapUsername="sAMAccountName"/>
</providers>
</membership>
In your web.release.config file, you can just swap out the whole membership section with the AD information and in the web.config you can leave it as it or only have the SQL provider.
For the web.release.config: