{"action":"opened","issue":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/1974","labels_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1974/labels{/name}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1974/comments","events_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1974/events","html_url":"https://github.com/NancyFx/Nancy/issues/1974","id":92149758,"number":1974,"title":"Razor `@model` doesn't work for nested layout with base model type","user":{"login":"Crisfole","id":413237,"avatar_url":"https://avatars.githubusercontent.com/u/413237?v=3","gravatar_id":"","url":"https://api.github.com/users/Crisfole","html_url":"https://github.com/Crisfole","followers_url":"https://api.github.com/users/Crisfole/followers","following_url":"https://api.github.com/users/Crisfole/following{/other_user}","gists_url":"https://api.github.com/users/Crisfole/gists{/gist_id}","starred_url":"https://api.github.com/users/Crisfole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crisfole/subscriptions","organizations_url":"https://api.github.com/users/Crisfole/orgs","repos_url":"https://api.github.com/users/Crisfole/repos","events_url":"https://api.github.com/users/Crisfole/events{/privacy}","received_events_url":"https://api.github.com/users/Crisfole/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-30T17:20:59Z","updated_at":"2015-06-30T17:20:59Z","closed_at":null,"body":"Currently the best I can do is give an example. I have a core layout:\r\n\r\n```\r\n<header>Header</header>\r\n<div id='wrapper'>@RenderBody()</div>\r\n```\r\nA subarea of the site with a layout inside:\r\n```\r\n@model MyInterfaceOrAbstractModel\r\n@{ Layout = \"layout\" }\r\n<section>Sub Section</section>\r\n@RenderBody()\r\n```\r\nAnd a bunch of cshtml files that use the sub layout. Unfortunately it doesn't work. I get a `System.NotSupportedException` with the following error message:\r\n\r\n    \"Unable to discover CLR Type for model by the name of MyInterfaceOrAbstractModel\"\r\n\r\nAt first I thought, oh my razor config must be wrong, but I proved that wrong because it works beautifully if I swap it out for an `@inherits` like so:\r\n```\r\n@inherits NancyRazorViewBase<MyInterfaceOrAbstractModel>\r\n@{ Layout = \"layout\" }\r\n<section>Sub Section</section>\r\n@RenderBody()\r\n```\r\n\r\nIs this a Razor fact of life, or a bug in Nancy's razor support?"}}