Old Site

This site is archived. I now update and maintain my blog here.

Incrementing the Umbraco Client Dependency version with Octopus Deploy

If you use Octopus deploy to deploy your Umbraco sites, you've probably forgotten to increment the Client Dependency version before building and deploying - which leads to old CSS and JavaScript being served.

Octopus Deploy allows you to run custom powershell scripts during the deployment life cycle - and the one below will set the client dependency version.

$Config = ".\config\ClientDependency.config";

If (Test-Path $Config) {

    $Cd = New-Object System.Xml.XmlDocument
$Rel = ($OctopusParameters['Octopus.Release.Number']);
    $Cd.clientDependency.version = $Rel.Replace(".", "");


If (Test-Path "bin\version.txt"){
Remove-Item "bin\version.txt"
"$($OctopusParameters['Octopus.Release.Number'])" | Out-File "bin\version.txt"

The script should be run post deployment. Rather than incrementing the client dependency version - it derives an integer from the octopus release version, so the client dependency version is distinct for each release.

If you need some help setting up Octopus deploy and Umbraco - get in touch with me, via my company website.


Leave a comment