Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Damgaard Mortensen 712 posts 1189 karma points
    Feb 29, 2016 @ 15:06
    Bo Damgaard Mortensen
    0

    Getting YSOD after upgrading a strongly typed solution to 7.4.1

    Hi all,

    I just upgraded (via NuGet) a 7.2 install to 7.4.1 and after everything about the upgrade went fine, I get an YSOD when trying to access the views.

    The views are all strongly typed with a MasterController which all other controllers inherits from. The master controller looks like this:

    public class MasterController : SurfaceController, IRenderMvcController
    {
        public ActionResult Index(RenderModel model)
        {
            return CurrentTemplate(model);
        }
    
        protected ActionResult CurrentTemplate<T>(T model)
        {                        
            var template = ControllerContext.RouteData.Values["action"].ToString();
            if (!EnsurePhsyicalViewExists(template))
            {                
                return HttpNotFound();
            }
            return View(template, model);
        }
    
        protected bool EnsurePhsyicalViewExists(string template)
        {
            var result = ViewEngines.Engines.FindView(ControllerContext, template, null);
            if (result.View == null)
            {
                return false;
            }
            return true;
        }
    }
    

    In 7.2 this worked just fine. The view models are just plain ol' objects which are not inheriting from anything.

    However, in 7.4.1 I get the following:

    enter image description here

    Is there's any "breaking" changes in the new version which would cause this? :-)

    Any help/hint is greatly appreciated! Thanks in advance.

Please Sign in or register to post replies

Write your reply to:

Draft