Skip to content

Instantly share code, notes, and snippets.

@LodewijkSioen
Created February 20, 2013 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LodewijkSioen/4998516 to your computer and use it in GitHub Desktop.
Save LodewijkSioen/4998516 to your computer and use it in GitHub Desktop.
Nancy embedded resource exception
hello world @Model.Name
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureApplicationContainer(Nancy.TinyIoc.TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
ResourceViewLocationProvider.RootNamespaces.Add(this.GetType().Assembly, "Test.Views");
//Bug in nancy 0.16.1?
ResourceViewLocationProvider.Ignore.Add(Assembly.Load("Nancy.ViewEngines.Razor"));
//End Bug
}
protected override NancyInternalConfiguration InternalConfiguration
{
get
{
return NancyInternalConfiguration.WithOverrides(x => x.ViewLocationProvider = typeof(ResourceViewLocationProvider));
}
}
}
public class Module : NancyModule
{
public Module()
{
Get["/"] = x => View["index.cshtml", new { Name = "test", Title = "TITLE" }];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment