So I've got an odd one, when we make changes to CSS that is loaded using Html.RequiresCss, which ends up being a Dependency Handler statement, the CSS changes aren't displayed on the live site.
Hi Nik,
There was a bug in certain versions of the ClientDependencyHandler nuget package in that it didn't set up the configuration properly in the web.config file.
If you don't see the following line in the web.config:
at the bottom of the config file then you have a problem.
Make sure that the web.config is pointing at the ClientDependency.config file in /config and you'll be able to refresh the cache simply by incrementing the version.
Editing CSS is not normally considered an Editor's job - do you really want them messing with the layout and style of the site?
You can also install the ConfigTree plugin in the Developers section which will give you access to editing the config files - I use this to do things like update the ClientDependency Version number.
The other thing I do is when I edit javascript or css files in my project, I also update the ClientDependency.config file as well and push it along with the edited files.
Dependency Handler not reflecting CSS changes
Hey guys/gals me again,
So I've got an odd one, when we make changes to CSS that is loaded using Html.RequiresCss, which ends up being a Dependency Handler statement, the CSS changes aren't displayed on the live site.
CSS File
Served File
How can I force Dependency Handler to pick up these CSS changes and server them?
I've tired republishing the whole site, re-saving the CSS, re-saving the template, clearing my local PC cache.
Cheers
Nik
Hi Nik, There was a bug in certain versions of the ClientDependencyHandler nuget package in that it didn't set up the configuration properly in the web.config file.
If you don't see the following line in the web.config:
but instead see something like this:
at the bottom of the config file then you have a problem.
Make sure that the web.config is pointing at the ClientDependency.config file in /config and you'll be able to refresh the cache simply by incrementing the version.
Looks like that could be it, my entry in web config looks as follows:
So I'll change it to bring it inline with your advice and see how it goes.
Does that mean if I change my CSS file I need to increment that value every time? It doesn't seem very "editor" friendly.
Editing CSS is not normally considered an Editor's job - do you really want them messing with the layout and style of the site?
You can also install the ConfigTree plugin in the Developers section which will give you access to editing the config files - I use this to do things like update the ClientDependency Version number.
The other thing I do is when I edit javascript or css files in my project, I also update the ClientDependency.config file as well and push it along with the edited files.
Just had to manually increment the ClientDependency version when I updated a Plugins CSS.
Otherwise, have never had to do this before as a developer or editor. Can't push the .config file itself since locally it's way behind the live site.
is working on a reply...