2011-08-22 88 views
1

按照本教程:http://aspalliance.com/1993_Replacing_ASPNET_Base_Pages_with_a_PageAdapter無法創建類型 - PageAdapter

它工作在我的測試項目,但在我的生產項目中,我得到以下錯誤:

Server Error in '/products' Application. 

Unable to create type 'Photocreator.ThemedPageAdapter'. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: Unable to create type 'Photocreator.ThemedPageAdapter'. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[Exception: Unable to create type 'Photocreator.ThemedPageAdapter'.] 
    System.Web.Configuration.HttpCapabilitiesBase.GetAdapter(Control control) +889 
    System.Web.UI.Control.ResolveAdapter() +214 
    System.Web.UI.Page.get_PageAdapter() +43 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +188 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.468 

這個會出現在所有頁面,這兩個項目都使用框架V4。

任何想法?

+0

你有沒有想過解決你的問題? –

+0

我這麼認爲,但是很久以前我真的不記得是什麼修復了。 – cja100

回答

0

這實質上是告訴你,ASP.NET運行時無法加載類型是Photocreator.ThemedPageAdapter適配器 - 你需要檢查

  1. 如果你給適配器類型名稱正確 (檢查命名空間等)
  2. 無論你是否有建立工程W/O任何錯誤
  3. 如果你有這個類在不同的組件(比網絡 項目等),然後嘗試給裝配合格的名稱(例如adapterType="Photocreator.ThemedPageAdapter, MyAssembly"),並確保 該程序集存在於bin文件夾中。

編輯: 確保適配器類型有公共(實例)構造函數不帶任何參數。如果這不是問題,那麼構造函數代碼可能會拋出一些異常。或者你的適配器有一個靜態構造函數,可能會引發一些異常。

+0

1.對於測試項目來說,這似乎都很好,很類似。 2.沒有構建錯誤。 3.它正在使用網站大會。我認爲它找到類很好,因爲當我在all.browsers文件中錯誤地拼寫名稱時,我得到一個不同的錯誤:無法加載類型'Photocreator.ThemedPageAddapter'。 – cja100

+0

@ cja100,在這種情況下,檢查你的適配器是否有一個公共參數少的實例構造函數。看我的編輯。 – VinayC

+0

我已經添加了一個,但它沒有區別。 – cja100