简体   繁体   中英

asp.net - web app vs web site - code behind

I have a asp.net website that was built a while back. I have went through the process of converting it with visual studio into a web app. Now that I have it converted I am having some trouble using classes from a class library that is added to the project. The code behind is slightly different (below). Can anyone give me suggestion on a solution.

--to clearify a little I have 3 visual studio projects

1 class library (data access layer) 1 class library (business logic layer) 1 website (presentation layer)-> which I converted into a web app project. with a process similar to this ( here )

I have a static method inside of the business logic layer that I can no longer access from the code behind in my presentation layer.

---- Web site -- /Profile/Default.aspx

using MyBusinessLogic;
public partial class Profile_Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        MyBusinessLogic.Profiles.GetUserInfo(UserName);
    }
}

---- Web app -- /Profile/Default.aspx

using MyBusinessLogic;
namespace WebApplication1.Profile
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MyBusinessLogic.Profiles.GetUserInfo(UserName); <---ERROR "can not access method on namespace"----------------------
        }
    }
}

I have faced similar issue in conversions. Please check for similar namespaces (Mybusinesslogic.Profiles) if you have resharper, just write profile.getuserinfo and check if it resolves to your correct business logic assembly or you have another duplicate existing in current namespace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM