我已經編寫了一個VirtualPathProvider來更改aspx頁面如何加載到我的ASP.Net應用程序中。作爲這個過程的一部分,我刪除了代碼隱藏文件,我只是確定我的頁面是從一個特定的頁面類繼承的。 如:BuildManager解決頁面繼承問題
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Namespace.PageClass" %>
如果我這樣做,我得到以下異常:
HttpParseException Could not load type 'Namespace.PageClass'
我也曾嘗試以下操作:
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Namespace.PageClass, AssemblyName" %>
這將產生以下錯誤:
HttpParseException Could not load the assembly 'AssemblyName'. Make sure that it is compiled before accessing the page.
應用程序啓動時我所需要的組件加載到當前應用程序域:
AppDomain.Current.Load(...)
在我假設的問題在於時刻與BuildManager爲解決命名空間/大會參考的能力....但如果誠實...這是一個猜測:-)
有人能夠說明這一點嗎?
是否存在堆棧跟蹤? – 2009-07-29 10:46:02
nope - 這一切都發生在System.Web內部,因爲頁面被解析...沒有堆棧跟蹤對我來說:-( – 2009-07-29 11:33:58