SharePoint WSP deployed but css not updated

There are many cases

  1. https://sharepoint.stackexchange.com/questions/96059/custom-css-not-updated
  2. http://johnliu.net/blog/2014/5/27/sp2010-forcing-previously-deployed-file-to-update-to-latest.html
  3. https://blog.kloud.com.au/2013/05/27/file-element-module-overwriteifalreadyexiststrue/
  4. http://nileshmandekar.blogspot.com.au/2012/04/avoiding-javascript-and-css-stylesheet.html
  5. http://sharepointerz.blogspot.com.au/2012/11/gac-deployment-but-code-doe-not-update.html

In my case number 4 is the solution.

If I deployed the wsp into another DEV machine, the css updated but after deploying into UAT the css is not the new one. so use ‘rev’ parameter!

<link href=”/_LAYOUTS/ProjectName/mystyles.css?rev=<build-version>” rel=”stylesheet” type=”text/css”>link>

<script src=”/_LAYOUTS/ProjectName/myscript.js?rev=<random number>” type=”text/javascript”> script>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: