遵循本教程:http://aspalliance.com/1993_Replacing_ASPNET_Base_Pages_with_a_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)
这实际上告诉您ASP.NET运行时无法加载Photocreator.ThemedPageAdapter
适配器的类型 - 您需要检查
adapterType="Photocreator.ThemedPageAdapter, MyAssembly"
)并确保
程序集存在于bin文件夹中。修改强>: 确保适配器类型具有不带任何参数的public(instance)构造函数。如果这不是问题,那么构造函数代码可能会抛出一些异常。或者你的适配器有一个静态构造函数,可能会抛出一些异常。