I’m getting an error for my web.config in my ASP.NET MVC3 Razor project where I’ve been working on a new branch:
The connection name 'ApplicationServices' was not found in the
applications configuration or the connection string is empty.
With this specific error:
Line 34: <providers>
Line 35: <clear/>
Line 36: <add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true"
requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="/"/>
Line 37: </providers>
Line 38: </membership>
In <connectionStrings> section of the web.config, there isn’t an entry for ApplicationServices. However, I’ve compared my web.config against previous versions that were working and this part of the webconfig hasn’t changed at all. My trunk has this same line in it also.
I’ve looked at the <connectionStrings> section and nothing has changed there either between this branch and the working trunk. So this means that a connection name wasn’t removed to trigger this error.
I’m wondering if there is something else I’ve changed in the project that is now surfacing an error for this line. But I have no idea what it might be. Any ideas?
I’m not sure what changed between your last revision and the current one. However, if you’re not using forms authentication, then there’s no need for this “membership” section; it should be safe to remove it. And that should fix the error you’re seeing. (Whether there will be other errors in its place is yet to be seen …)