Moving From Casini to IIS, Login Fails. How come?
ASP.NET 2.0 Membership
A very common question that comes up while using ASP.NET 2.0 Membership is that when moving a web application from the local developer environment with Visual Studio 2005 (VS2005) to IIS is that login no longer works. Almost everytime this happens, it comes down to the application name in the Membership Profile of Web.Config is set to / instead of the actual application name. That is, if you you were to look at your web.config, this is what you would see.
133 <roleManager enabled=“true“/>
134 <membership>
135 <providers>
136 <remove name=“AspNetSqlMembershipProvider“/>
137 <add name=“AspNetSqlMembershipProvider“
138 type=“…“
139 connectionStringName=“LocalSqlServer“
140 enablePasswordRetrieval=“false“
141 enablePasswordReset=“true“
142 requiresQuestionAndAnswer=“true“
143 applicationName=“/“
144 requiresUniqueEmail=“false“
145 minRequiredPasswordLength=“1“
146 minRequiredNonalphanumericCharacters=“0“
147 passwordFormat=“Hashed“
148 maxInvalidPasswordAttempts=“5“
149 passwordAttemptWindow=“10“ p=“”
150 asswordStrengthRegularExpression=“”/>
151 </providers>
152 </membership>
Notice that the applicationName is set to just a "/". To make the application work with IIS, you really need to set that to the name of your application. That is, the correct way to specify applicationName is something more like this:
133 <roleManager enabled=“true“/>
134 <membership>
135 <providers>
136 <remove name=“AspNetSqlMembershipProvider“/>
137 <add name=“AspNetSqlMembershipProvider“
138 type=“…“
139 connectionStringName=“LocalSqlServer“
140 enablePasswordRetrieval=“false“
141 enablePasswordReset=“true“
142 requiresQuestionAndAnswer=“true“
143 applicationName=“/MyCoolApp1“
144 requiresUniqueEmail=“false“
145 minRequiredPasswordLength=“1“
146 minRequiredNonalphanumericCharacters=“0“
147 passwordFormat=“Hashed“
148 maxInvalidPasswordAttempts=“5“
149 passwordAttemptWindow=“10“ p=“”
150 asswordStrengthRegularExpression=“”/>
151 </providers>
152 </membership>
This also makes it so that you can share the same membership database across multiple applications.











October 22nd, 2006 at 6:36 pm
Scott Guthrie has a more advanced discussion on this at the following URL:
http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx
January 21st, 2008 at 11:20 am
Hi,
This problems seems similar to what I am having. Consider a simple application that has membership, roles, a Login control and set in web config.
Logging in works fine in debug but after ‘Publish Web Site’ to the same computer, different virtual directory, login fails.
I tried this code and I tried
[assembly: ApplicationName("Calculator")]
Neither one fixed the problem. Would you have any advice?
(FYI: the security code thing did not work in firefox)
December 19th, 2009 at 2:19 am
Hello
I loose control!
Free java casino no download
casino
List flash no download casino
casino
Virtual casino birthday welcome bonus
casino
Flash no download casino without deposit
casino
Internet poker web sites