AI OnAI Off
Sounds like you have a bad casting to StartPage somewhere in the
EPIServerExtranet.Business.PageViewContextFactory.CreateLayoutModel
So check that method and see if it tries to cast the current page to a startpage. Looks like you have a call like
contentRepository.Get<StartPage>(currentContentLink)
or similar which will crash and burn because currentContentLink points to an article page.
Instead do something like:
var currentPage = contentRepository.Get<IContent>(currentContentLink); var startPage = currentPage as StartPage; if(startPage!=null) { //Create layout if you are on start page.... }
Hi ,
After hosting my EPi site in IIS , while browsing the same , I am getting the following error after login(using windows authentication)
Server Error in '/' Application.
Content with id '183' is of type 'Castle.Proxies.ArticlePageProxy' which does not inherit required type 'EPIServerExtranet.Models.Pages.StartPage'
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: EPiServer.Core.TypeMismatchException: Content with id '183' is of type 'Castle.Proxies.ArticlePageProxy' which does not inherit required type 'EPIServerExtranet.Models.Pages.StartPage'
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:
Please let me know what I need to do here.
Thanks in advance.