Iam using Nancy Framework with C# and my views are rendered from HTML files. If i need to udate the code in my HTML,CSS or JS (which is part of the content), I have to go through the long annoying process of
Please help me if u have a better way of doing this if not maybe just explain to me why i always have to wait a few more seconds for the first run of the C# project to start allowing connections on the browser.
Nancy does not cache CSS or JS files, they are pass-through files when they exist under Content folder, or if you explicitly set them up in the static conventions.
To disable View Caching, simply disable caches in your bootstrapper:
StaticConfiguration.DisableCaches = true
Edit:
Based on your comment:
https://github.com/richorama/Jukebox/blob/master/Jukebox/Controllers/Home.cs#L11
namespace Jukebox.Controllers
{
public class Home : NancyModule
{
public Home()
{
Get["/"] = x =>
{
return Response.AsFile("default.htm");
};
}
}
}
This will load the htm file off the disk every request. So I'm not entirely sure what issues you're running into. None-the-less try disabling the caches.
Also caching is only enabled when you're running the code in Release mode...
Edit 2:
Since you're using a console app and files are copied to the bin.
https://github.com/NancyFx/Nancy/wiki/The-root-path#changing-the-root-path
Create a implementation of the rootpath provider pointing to your dev directory. Configure it to only run during development.