Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob Watkins 369 posts 701 karma points
    Jul 05, 2018 @ 08:32
    Rob Watkins
    0

    Get ClientDependency to use build number

    Is it possible to get ClientDependency to automatically use the build number of a specified assembly, rather than the manually incremented config one?

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Jul 05, 2018 @ 09:39
    Kevin Jump
    0

    Hi Rob,

    the short answer is yes - the long answer is it really depends on what your build / deployment process is.

    Using Visual Studio Team Services for example you can do some variable replacement to put the build number into the clientdependency.

    you can use things like Replace Tokens, https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens

    to change the value in the file at build time for this you have a parameters.xml file in your solution

    <?xml version="1.0" encoding="utf-8" ?>
    <parameters>
      <parameter name="ClientDependency.Version"
                 description="Change the Client DependencyVersion - new minified files"
                 defaultValue="#{ClientDependency.Version}#"
                 tags="">
        <parameterEntry
          kind="XmlFile"
          scope="ClientDependency\.config$"
          match="/clientDependency/@version" />
      </parameter>
    </parameters>
    

    and you can set the version to be the build number in your release :

    enter image description here

    you can also use poweshell scripts as part of a something like and octopus deployment to increment the version number.

    For example i have used something like this in the past: http://blog.darren-ferguson.com/2016/04/30/incrementing-the-umbraco-client-dependency-version-with-octopus-deploy/

    where the number is incremented by the script when the build is made.

    there are a few other ways its sort of depends.

    edit: for completeness there is also the MSBuild way (in the comments on the post above)

    https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/85268-howto-get-msbuild-to-update-the-client-dependency-framework

Please Sign in or register to post replies

Write your reply to:

Draft