开发者

Unable to create type - PageAdapter

Following this tutorial: http://aspalliance.com/1993_Replacing_ASPNET_Base_Pages_with_a_PageAdapter

It works in a test project of mine, but in my production project I get the following error:

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.

St开发者_开发知识库ack 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

This appears on all pages, both projects are using framework V4.

Any Ideas?


This is essentially telling you that ASP.NET runtime unable to load the type for the adapter which is Photocreator.ThemedPageAdapter - you need to check

  1. if you have given the adapter type name correctly (check for namespace etc)
  2. Whether you have build the project w/o any errors
  3. in case you have this class in different assembly (other than web project) then try giving assembly qualified name (e.g. adapterType="Photocreator.ThemedPageAdapter, MyAssembly") and make sure that the assembly is present in bin folder.

EDIT: Make sure that the adapter type has public (instance) constructor that does not take any parameters. If that's not the problem then perhaps constructor code is throwing some exception. Or your adapter has a static constructor and that might be throwing some exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜