[英]asp.net - web app vs web site - code behind
我有一個早已建立的asp.net網站。 我已經經歷了使用Visual Studio將其轉換為Web應用程序的過程。 現在,我已經對其進行了轉換,在使用添加到項目中的類庫中的類時遇到了一些麻煩。 后面的代碼略有不同(如下)。 誰能給我關於解決方案的建議。
-為了澄清一點,我有3個Visual Studio項目
1個類庫(數據訪問層)1個類庫(業務邏輯層)1個網站(表示層)->我轉換為Web應用程序項目。 具有與此類似的過程( 此處 )
我在業務邏輯層中有一個靜態方法,無法再通過表示層中的代碼訪問。
----網站-/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應用程序-/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"----------------------
}
}
}
我在轉換中也遇到過類似的問題。 如果您有共享工具,請檢查類似的名稱空間(Mybusinesslogic.Profiles),只需編寫profile.getuserinfo並檢查它是否可以解析為正確的業務邏輯程序集,或者當前名稱空間中是否存在另一個重復項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.