Created
February 20, 2013 19:29
-
-
Save LodewijkSioen/4998516 to your computer and use it in GitHub Desktop.
Nancy embedded resource exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello world @Model.Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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