1

I've jumped many hurdles, but alas I still see the default 404 iamge rendered by Nancy. I've 'mastered' project.json so I can embed my assets (including /assets/views/index.html), using the following block in the project.json file:

 "buildOptions": {
  "embed": [
    "assets/**",
    "Content/**",
    "fonts/**",
    "Scripts/bootstrap.js",
    "Scripts/jquery-2.2.2.js",
    "Scripts/mustache.js",
    "favicon.ico"

    //, "Scripts/**" - include this and build fails with errors in *.targets (!)
  ]
}

This is confirmed when debugging and querying assembly resources. All good.

My Bootstapper contains:

        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
    {
        DependencyResolver.ConfigureDependencies(container);
        ResourceViewLocationProvider
            .RootNamespaces
            .Add(GetAssembly(), "<name to assembly>");  //embedded resource directory location
    }

And yet in my IndexModule:

    public class IndexModule : NancyModule
{
    public IndexModule() 
    {
        Get("/", args => Response.AsFile("assets/views/index.html", "text/html"));
    }
}

This renders nothing... could I be missing anything ? It was working fine with .Net Framework

penderi
  • 8,673
  • 5
  • 45
  • 62

0 Answers0