Unable to cast Hero to Hero Error
# help-with-umbraco
h
We are currently getting this a lot on our site and it seems there is no real reason. No change but it sort of solves itself again... System.InvalidCastException: [A]Umbraco.Cms.Web.Common.PublishedModels.Hero cannot be cast to [B]Umbraco.Cms.Web.Common.PublishedModels.Hero. Type A originates from 'ModelsGeneratedAssembly, Version=0.0.0.5, Culture=neutral, PublicKeyToken=null' in the context '"" Umbraco.Cms.Web.Common.ModelsBuilder.InMemoryAuto.UmbracoAssemblyLoadContext #1' at location 'C:\Windows\TEMP\ucmw01l2.fkj'. Type B originates from 'ModelsGeneratedAssembly, Version=0.0.0.3, Culture=neutral, PublicKeyToken=null' in the context '"" Umbraco.Cms.Web.Common.ModelsBuilder.InMemoryAuto.UmbracoAssemblyLoadContext #4' at location 'C:\Windows\TEMP\wcyetanj.1na'.
u
Are you using uskinned? I used to to get this from time to time on a uskinned site after deploying code changes. I never managed to solve it, but got into the habit of checking certain pages after a deployment and 'touching' the web.config to cause the site to restart. It never happened consistently so it was impossible to fix. It's worth noting this was on the older tempates and the older version of Umbraco and it's never happened with SiteBuilder and currently supported version of Umbraco.
h
Never heard of unskinned?
We use Igloo
9 Views