We recently upgraded to 9.1 and updated our glassmapper to 5.4.1. After doing the upgrade and running our application I am getting this error. We dont have any model definition in siteocre and this is our layout page. i have spent the better part of my 2 days trying to figure out the reason. Any guidance on this would help.
Server Error in '/' Application.
The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary
requires a model item of type MyProjectNameSpace.Model
Description: An unhandled exception occurred.
Exception Details: System.InvalidOperationException: The model item passed into the dictionary is of type
'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary
requires a model item of type MyProjectNameSpace.Model.
This is full error on the page.
My Layout.Cshtml File has the following code : ( i tried both ways. line 3 / line 4)
Please ignore the error on my model name. i just changed it for the sake of screenshot. in reality it will have a proper namespace and model name.
Also this ishappening with new Glassmapper version. never had the issue with sitecore 8.1 and older version of GM.