my logout and login is locked up. several files are saying that the membership user could not be found are you missing a directive or assembly influence. here is one of the files
namespace EP.BumplesMagazine.UI.User
{
public partial class ActivateAccount : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
String email = String.Empty;
String token = String.Empty;
if (Request.QueryString["email"] != null)
email = Request.QueryString["email"].ToString();
if (Request.QueryString["token"] != null)
token = Request.QueryString["token"].ToString();
if (email == String.Empty && token == String.Empty)
Response.Redirect("~/Default.aspx");
I am not getting any debugging errors when I run it in visual studio. The program was built in 2009 and has been upgraded to 4.0
The MembershipProvider abstract class is part of the System.Web.ApplicationServices namespace in the .net 4.0 Framework. Add a reference to that assembly and it should solve the issue.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Thank you very much for getting back to me so fast. I put the 4.0.0.0 in the main web config. where the 2.0.0.0 was and it closed my site with a server error. So I had to put 2.0 back in. TDoes that mean that there is another place where I need to change
the 2.0 to 4.0 ?
Also, it did not change the membership user problem but I was able to redo a default and fix the login problem. I still have a password problem but the site is working again.
AI am a self taught programmer and not very good at this but I keep trying to learn. Mainly by looking at what the first programmer did.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
9 Points
214 Posts
missing a directive or assemby reference- is it an error in config
Sep 12, 2017 09:04 PM|bumples18|LINK
my logout and login is locked up. several files are saying that the membership user could not be found are you missing a directive or assembly influence. here is one of the files
namespace EP.BumplesMagazine.UI.User
{
public partial class ActivateAccount : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
String email = String.Empty;
String token = String.Empty;
if (Request.QueryString["email"] != null)
email = Request.QueryString["email"].ToString();
if (Request.QueryString["token"] != null)
token = Request.QueryString["token"].ToString();
if (email == String.Empty && token == String.Empty)
Response.Redirect("~/Default.aspx");
Boolean userFound = false;
// authoriza email
MembershipUserCollection emailAccount = Membership.FindUsersByEmail(email);
foreach (MembershipUser user in emailAccount)
{
if (user.Comment == token)
{
user.IsApproved = true;
user.Comment = String.Empty;
Membership.UpdateUser(user);
// Authorize user
if (!Roles.RoleExists("Registered"))
Roles.CreateRole("Registered");
Roles.AddUserToRole(user.UserName, "Registered");
userFound = true;
}
}
if (!userFound)
Response.Redirect("~/Default.aspx");
//set focus
LoginBox.SetFocus();
}
//PanelMessage.Visible = false;
}
}
}
below is my web conf for the user files
<configuration>
<location path="EditProfile.aspx">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="ChangePassword.aspx">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="OrderHistory.aspx">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>
I am not getting any debugging errors when I run it in visual studio. The program was built in 2009 and has been upgraded to 4.0
Hope you can help as no one can log in.
thanks,
Jen
Contributor
6490 Points
2525 Posts
Re: missing a directive or assemby reference- is it an error in config
Sep 13, 2017 02:34 AM|Jean Sun|LINK
Hi bumples18,
The MembershipProvider abstract class is part of the System.Web.ApplicationServices namespace in the .net 4.0 Framework. Add a reference to that assembly and it should solve the issue.
Best Regards,
Jean
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
9 Points
214 Posts
Re: missing a directive or assemby reference- is it an error in config
Sep 13, 2017 04:02 PM|bumples18|LINK
Thank you very much for getting back to me so fast. I put the 4.0.0.0 in the main web config. where the 2.0.0.0 was and it closed my site with a server error. So I had to put 2.0 back in. TDoes that mean that there is another place where I need to change the 2.0 to 4.0 ?
Also, it did not change the membership user problem but I was able to redo a default and fix the login problem. I still have a password problem but the site is working again.
AI am a self taught programmer and not very good at this but I keep trying to learn. Mainly by looking at what the first programmer did.
Thank you very much for your help.
Jen
Contributor
6490 Points
2525 Posts
Re: missing a directive or assemby reference- is it an error in config
Sep 15, 2017 07:07 AM|Jean Sun|LINK
Hi bumples18,
What is the password problem do you have now?
And you can try the following link about the migration problems.
https://docs.microsoft.com/en-us/aspnet/whitepapers/aspnet4/breaking-changes#0.1__Toc256770156
Best Regards,
Jean
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.