c# - Nancy - embedded views from other assembly -
i have created 2 projects:
class library file views\other.html set embedded resource.
console app nancy self-hosting set up, bootstrapper , nancy module responds returning view named "other.html" - 1 defined in other assembly.
bootstrapper config:
protected override void configureapplicationcontainer(tinyioccontainer container) { base.configureapplicationcontainer(container); resourceviewlocationprovider.rootnamespaces.add(gettype().assembly, "consoleapplication1.views"); // (1) resourceviewlocationprovider.rootnamespaces.add(typeof(class1).assembly, "classlibrary1.views"); } protected override nancyinternalconfiguration internalconfiguration { { return nancyinternalconfiguration.withoverrides(onconfigurationbuilder); } } private void onconfigurationbuilder(nancyinternalconfiguration x) { x.viewlocationprovider = typeof(resourceviewlocationprovider); }
application starts configuration fails return "other.html" defined embedded resource of other library.
it works ok when return view embedded in main console app.
when remove line marked (1) app fails start following error:
unable resolve type: nancy.viewengines.viewengineapplicationstartup 1 view found in assembly consoleapplication1, version=1.0.0.0, culture=neutral, publickeytoken=null, no rootnamespace had been registered.
what missing here?
problem solved at: https://groups.google.com/forum/#!topic/nancy-web-framework/9n4f6-y4dna
looks available nuget package doesn't contain fix !!!
i decompiled 0.22 nuget package , me change isn't there. on github.
Comments
Post a Comment