Problem was found as mentioned in comments of original question.
Nancy does not have a concept of a Shared Views folder like ASP.NET MVC.
The normal way to do this would be to put the _Layout.cshtml
in the root of the /Views
folder.
If you want to avoid the view being in the root folder or avoid specifying the full path, you can add a View Location to the list like so:
public class CustomConventionsBootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
this.Conventions.ViewLocationConventions.Add((viewName, model, context) =>
{
return string.Concat("views/shared/", viewName);
});
}
}
Documentation can be found here:
https://github.com/NancyFx/Nancy/wiki/View-location-conventions#defining-custom-conventions