I am using Nancy 0.14.1.0 with a view of Razor. Everything is going fine as long as I work with the internal web server in VS 2010. Now I deployed the material on my web server with IIS 6. Route
Get["/api/v1/admin/clients"] = parameters => { return View["Admin/view", new DataAccessLayer(Context).admin_get_clients()]; };
which returns a list of customers (it doesn't matter here).
Directory structure on the server
bin
Content
Shared
| --- _Layout.cshtml
Views
| --- Admin
| --- view.cshtml
The exception that I catch is
Nancy.ViewEngines.ViewNotFoundException: Unable to locate view 'Admin / view' Currently available view engine extensions: sshtml, html, htm Locations inspected: ,,,, views / api / Admin / view, api / Admin / view, views / Admin / view, Admin / view Root path: C: \ Inetpub \ Websites \ Test \ api \
As far as I am concerned, this is a record of “available extensions for viewing”: I am skipping cshtml here ... although I think my web.config contains the correct entry:
<compilation debug="true" targetFramework="4.0"> <buildProviders> <add extension=".cshtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyCSharpRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" /> <add extension=".vbhtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyVisualBasicRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" /> </buildProviders> </compilation>
Nancy module works fine: I added a route
Get["/api/v1/admin/clients/{id}"] = parameters => { return "Hello"; };
and get "Hello" ...
Any clues?