2011-08-22 86 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