After setting up the login users, stored on ASPNETDB.mdf, and tested the WebApp on Visual Studio, i published the site to my server.
The index.aspx file shows the result of a query on my ASPNETDB.mdf file - all fine with that.
But when i try to login, all the users account give me: "Your login attempt was not successful. Please try again."
I have my ASPNETDB.mdf file in App_Data folder, i did nothing in particular, just publish from Visual Studio. I have SQL Server Express running on my server, the result showed by the query made in the
index.aspx file is fine too.
So my question is, why isn't the login accounts working? Any idea?
Make sure that you have the name of the application set up in the Membership registration section of the web.config. If not there is no way for the membership provider to corelate your production app to the development applications and it then relies on
the url and creates a new application entry
By checking on my asp_Applications table, i see that the applicationName is set to "/", that's why i putted that in the web.config file.
Why should i put "MyWebsite" as a name? From wath i've read from scott Gu article, putting "/" as the applicationName should fix the deployment issue...
Anyhow, setting the ApplicationName to "Mywebsite" gives me an exception when running it:
Parser Error Message: The entry 'AspNetWindowsTokenRoleProvider' has already been added.
Line 40: <providers>
Line 41:
Line 42: <add
Line 43: applicationName="MyWebSite"
Line 44: name="AspNetWindowsTokenRoleProvider"
nmpgaspar
Member
5 Points
22 Posts
Deployment problem
May 07, 2008 05:46 PM|LINK
After setting up the login users, stored on ASPNETDB.mdf, and tested the WebApp on Visual Studio, i published the site to my server.
The index.aspx file shows the result of a query on my ASPNETDB.mdf file - all fine with that.
But when i try to login, all the users account give me: "Your login attempt was not successful. Please try again."
I have my ASPNETDB.mdf file in App_Data folder, i did nothing in particular, just publish from Visual Studio. I have SQL Server Express running on my server, the result showed by the query made in the index.aspx file is fine too.
So my question is, why isn't the login accounts working? Any idea?
Jeev
All-Star
24182 Points
3719 Posts
Re: Deployment problem
May 07, 2008 05:54 PM|LINK
Make sure that you have the name of the application set up in the Membership registration section of the web.config. If not there is no way for the membership provider to corelate your production app to the development applications and it then relies on the url and creates a new application entry
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
nmpgaspar
Member
5 Points
22 Posts
Re: Deployment problem
May 07, 2008 09:18 PM|LINK
I have no Membership tag in web.config file. I just have:
<roleManager enabled="true"/>
i replaced it with:
<roleManager enabled="true"><
providers> <clear/><
add type="System.Web.Security.RoleProvider, System.Web" name="AspNetSqlRoleProvider" applicationName="/" /></
providers>and now i'm getting an exception: Parser Error Message: Provider must implement the class 'System.Web.Security.RoleProvider'.
Wath should i replace with? Include Membership just like in the article? Or include de ApplicationName in RoleManager? How?
nmpgaspar
Member
5 Points
22 Posts
Re: Deployment problem
May 08, 2008 04:13 PM|LINK
From wath i've read from microsoft website,
<roleManager enabled="true"><providers><
add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /></
providers></
roleManager>Should have done the trick. But i'm still getting the same problem.
If i put <clear/> before the <add> i get an exception. How should i fix that?
Jeev
All-Star
24182 Points
3719 Posts
Re: Deployment problem
May 08, 2008 04:35 PM|LINK
See the applicationName rather that "/" give it a name
eg" applicationName="Mywebsite"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
nmpgaspar
Member
5 Points
22 Posts
Re: Deployment problem
May 08, 2008 04:46 PM|LINK
By checking on my asp_Applications table, i see that the applicationName is set to "/", that's why i putted that in the web.config file.
Why should i put "MyWebsite" as a name? From wath i've read from scott Gu article, putting "/" as the applicationName should fix the deployment issue...
Anyhow, setting the ApplicationName to "Mywebsite" gives me an exception when running it:
Parser Error Message: The entry 'AspNetWindowsTokenRoleProvider' has already been added.
Line 40: <providers>
Line 41:
Line 42: <add
Line 43: applicationName="MyWebSite"
Line 44: name="AspNetWindowsTokenRoleProvider"
..
nmpgaspar
Member
5 Points
22 Posts
Re: Deployment problem
May 11, 2008 01:56 AM|LINK
anyone?
Can't figure wath i am doing wrong..