Try our conversational search powered by Generative AI!

TemplateResolver error

Vote:
 

Hi

i have a Episerver 7 (patch 3) MVC 4 site running. through debug in Visual Studio i have created a page using StandardTestPage model and StandardPageController and i called it page1. 

when i debug it through Visual Studio the page opens up fine: http://localhost:37009/page1/ and the log file writes:

DEBUG 2013-06-07 07:23:02 EPiServer.Web.TemplateResolver: StandardTestPage: Selected Pdk.Website.Controllers.StandardController. (tag='', channel='', category='Page')

when i try to open the same page when hosted in my local IIS version 7.5 i get an error 

DEBUG 2013-06-07 07:25:31 EPiServer.Web.TemplateResolver: StandardTestPage: Selected . (tag='', channel='', category='Page')
ERROR 2013-06-07 07:25:31 EPiServer.Global: 1.2.5 Unhandled exception in ASP.NET
System.Web.HttpException (0x80004005): The file '/link/6b5060bac8f54c41b49c48a740535efa.aspx' does not exist.
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.Routing.PageRouteHandler.GetHttpHandler(RequestContext requestContext)
at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

i also cannot preview the page when hosted in IIS, i can edit it though.

i guess the problem is in the line:

DEBUG 2013-06-07 07:25:31 EPiServer.Web.TemplateResolver: StandardTestPage: Selected . (tag='', channel='', category='Page')

"Selected ."  seems wrong. What is happening here?

#72059
Jun 07, 2013 7:44
Vote:
 

after using ½ a day to figure out what was wrong i gave up, and did the easy thing, i just created a new episerver 7 solution and copied all code to that and now it works.

#72069
Jun 08, 2013 10:22
Vote:
 

Could it be that when running under IIS you run it as a virtual appliation (compared to a site), and that the aspx file cant be resolved in that case?

What I am suspecting is that the application fails to locate the physical aspx file in one of the cases. Are you using TemplateDescriptor attribute on your aspx file? if so make sure Path property is application relative (that is start with ~/). 

You could try to setup log4net logging for EPiServer.Web.TemplatePathResolver.

#72153
Jun 10, 2013 11:02
Vote:
 

Sorry, now when I read your post again I see that you are using MVC. The Path property and TemplatePathResolver only applies for WebForms.

#72154
Jun 10, 2013 11:03
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.