I started out with a simple MVC-site using NancyFx with Razor-views (.cshtml
) and Nancy.Hosting.Aspnet
, using IIS Express. Now I adapted the project to a self-hosting service using Nancy.Hosting.Self
(and TopShelf).
However, to provide the Views, it seems I need to change their properties from None
& Do not copy
to Content
& Copy if newer
, so they are copied to .\bin\Debug\
.
One consequence is that changes to the Views will not be shown/updated until a restart. Even when working in debug-mode, where caching is disabled by default. I know this is just a minor annoyance, but still an annoyance, and it is nice to be able to try (cs)HTML-changes right away. So I was wondering is there a way to fix this, e.g. to prevent having to set the files to Copy if newer
?
You will need to set these values:
You can provide a custom root path that looks directly at the views folder in your project.