I have setup DD4T 2 with MVC 5 following the blog - http://blog.building-blocks.com/technical-tips/getting-started-with-dd4t-1-31-asp-net-mvc4-and-sdl-tridion-2013.
Though, I am facing issue while hitting url of my hosted webapp, saying 404 "resource not found". I also checked the related blog, Getting 404 error in DD4T but this is more specific to version 1.31.
I already have a website setup with DD4T 1.31 MVC 4 which works fine . I have compared the configurations of both and everything looks fine.
On further diagnosis, I found that the url is null (which is causing 404) when it hits Page action of PageController, I modified code to manually through the intended page as below -
public override ActionResult Page(string url)
{
return base.Page("Dummyview.html");
}
Due to this manual change, 404 error vanished, though I landed in another error while calling RenderComponentPresentations(), below is the complete error with stacktrace -
The controller for path '/dd4t2/' 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: System.Web.HttpException: The controller for path '/dd4t2/' was not found or does not implement IController. Source Error: Line 7: } Line 8: This is a page Line 9: @Html.RenderComponentPresentations() Source File: d:\opt\apps\tridion\DD4T2\Views\Page\DummyView.cshtml Line: 9 Stack Trace: [HttpException (0x80004005): The controller for path '/dd4t2/' was not found or does not implement IController.] System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +321 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +169 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.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +41 [HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information.] System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +178 System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3977 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +275 System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +94 System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +716 System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +123 DD4T.Mvc.Html.DefaultComponentPresentationRenderer.RenderComponentPresentation(IComponentPresentation cp, HtmlHelper htmlHelper) +684 DD4T.Mvc.Html.DefaultComponentPresentationRenderer.ComponentPresentations(IPage tridionPage, HtmlHelper htmlHelper, String[] includeComponentTemplate, String includeSchema) +924 DD4T.Mvc.Html.TridionHelper.RenderComponentPresentations(HtmlHelper helper, String[] byComponentTemplate, String bySchema, IComponentPresentationRenderer renderer) +1000 ASP._Page_Views_Page_DummyView_cshtml.Execute() in d:\opt\apps\tridion\DD4T2\Views\Page\DummyView.cshtml:9 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +110 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97 System.Web.Mvc.Async.c__DisplayClass21.b__1e(IAsyncResult asyncResult) +241 System.Web.Mvc.Controller.b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19 System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34280