0
votes

We are using Sitecore 7.2 with ASP.NET MVC. The mvc page works with now issue when viewing directly via URL or previewing from Publish > Preview.

However, following exception is thrown when we try to preview from Presentation > Preview.

The controller for path '/mysite/Home/test' was not found or does not implement IController.

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: Sitecore.Mvc.Diagnostics.ExceptionWrapper: The controller for path '/mysite/Home/test' was not found or does not implement IController.

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:

[ExceptionWrapper: The controller for path '/mysite/Home/test' was not found or does not implement IController.]

[ControllerCreationException: Could not create controller: 'Home'. ]
Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +371
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +270 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +147
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12272591 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

Not sure why but sitecore seems to pass different query string parameters for Presentation > Preview vs. Publish > Preview.

If someone can print to right direct to fix this will be great.

1
I don't have an answer for you, but this might give you some insight in to the differing behaviour: stackoverflow.com/questions/20518421/…Martin Davies

1 Answers

0
votes

I did not worked with MVC in Sitecore, still if controller is referring to Home Item you should check this settings in Web.Config

<site name="modules_shell" virtualFolder="/sitecore modules/shell" physicalFolder="/sitecore modules/shell" rootPath="/sitecore/content" startItem="/home" language="en" database="core" domain="sitecore" content="master" enableAnalytics="false" enableWorkflow="true" /> 

You will need to check rootPath and startItem.