Thursday, November 06, 2008

Kentico Error: Unable to cast object of type 'ASP.cmstemplatelayouts_blankmasterpage_ascx' to type 'CMS.PortalControls.CMSAbstractLayout

While working with Kentico CMS I have came across this annoying error.

Unable to cast object of type 'ASP.cmstemplatelayouts_blankmasterpage_ascx' to type 'CMS.PortalControls.CMSAbstractLayout

This is due the fact that the website is currently precompiling or related with a pre-compilation error with the website.

I normally fix this error my restart IIS or the app pool for the website.


  1. Hi Javier,

    Your practice is just right in this case. This error is actually more a oriented since the recompilation process can sometimes go wrong (thanks to caching related issues etc...).

    If you will have any questions, please don't hesitate to ask Kentico support team at:
    support [at]

    Have a nice weekend!

  2. Could you please send the ASCX code of the precompiled layout that is causing this error to the: support [at]

  3. javier ,even i got similar kind of problem with Kentico cms,can you please help me with it ,i will send details to support [at] . thank you

  4. Thanks a lot for sharing the info....

    Kentico Developers

  5. Hi,

    Nice post,thanks for sharing this information.

    kentico developers