Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Plugin Information

View change-assembly-version-plugin on the plugin site for more information.

This plug-in change the [AssemblyVersion] and [AssemblyFileVersion] from AssemblyInfo.cs sources.


The plugin will change the AssemblyVersion of all files named AssemblyInfo.cs (or other inserted) under the workspace folder.
It's recommended use the plugin with the default templates that are generated with visual studio.


Specify the version you want to change adding the Change assembly version in build step, and putting the version you want in the Assembly version input, like the image below

You can insert a hardcoded version like "1.0.5", but the plugin don't support syntax like 1.0.%someVariable% yet.

If you are attempting to use a version number with variable or regex or other combinations: 

  • %s in "ReplacementPattern" field will be replaced by "Assembly Version" field (uses java format string variables)
  • You can use regex grouping also: 
    • RegexPattern:
    • ReplacementPattern:

This will find both AssemblyVersion and AssemblyFileVersion and replace with the version specified in "Assembly Version" field.


Release 1.4

Support to set the regex to change the version,

Thanks to pjangam

Release 1.3

Now it can receive various assemblies files, separeted by comma, like:

AssemblyInfo.cs, AssembliSomeThingInfo.cs

Release 1.2

Add a field to specify the name of the AssemblyInfo file instead of only the AssemblyInfo.cs

Release 1.1

Initial Release of the plugin.



  1. Unknown User (arpitgold)

    Hi Leonardo Kobus,

    It is a very good plugin and very useful for any .Net guy who is using Builds via Jenkins.

    We are using CommonAssemblyInfo.cs instead of AssemblyInfo.cs. Can you please give an additional Features to mention another file name instead of hardcoded "AssemblyInfo.cs"

    I think it will also helpful for other.

    1. Unknown User (lkobus)

      Hi Nagar, I'm going to try release this feature today, if I can't, the release comes in monday


      1. Unknown User (arpitgold)

        Thanks Leonardo Kobus, 

        for your quick response and updated release.

  2. Unknown User (arpitgold)

    Hi Kobus,

    This plugin did not working with MultiJob plugin.

    If I select New Project as MultiJob Project, change Assembly Version does not comes in Add build Steps.

    Can you please look into it.


    Arpit Nagar

    1. Unknown User (lkobus)

      Hi Nagar, made the modification to the release 1.2.1, soon will be disponible.

      1. Unknown User (arpitgold)

        Hi kobus,

        you works like a bullet. Thanks for your quick response :)

  3. Unknown User (arpitgold)

    Hi Kubos,

    Can you please provide a functionality to pass multiple file name [may be "," seperated values] like [CommonAssemblyInfo.cs ,  AssemblyInfo.cs]

    So that if any solution have multiple AssemblyInfo with different names can have proper Assembly Info.



    1. Unknown User (lkobus)

      Hi, nagar I'm out of time this week, I'll try to make this modification next week.

      As workaround now, you can call various change assembly version in your build step, each one pointing to a diferent file.

      1. Unknown User (arpitgold)

        Hi Kobus,

        Thanks for your quick fix, but I have plenty of jobs. So I am avoiding to do this. I can wait till permanent solution.

        Did you get time, to look into it.


        Arpit Nagar

        1. Unknown User (lkobus)

          Hi nagar, I made the modification and released today! soon will be disponible.


          1. Unknown User (arpitgold)

            Thanks kobus (smile)

  4. Unknown User (ancient)


    I have tried this plugin with simple assembly version, but after it worked, it got '?' in front of each assemblyinfo.cs file. Assembly version has changed though. 

    1. Unknown User (lkobus)

      Hello Igor, wich version of the plugin are you using?
      And how is your assembly Info File ? can you put a example (just the lines where contains the versions).

    2. Unknown User (trampleduf)

      I'm having the sample problem. Version 1.4.1 of the plug-in. A question mark is inserted as the first character of every AssemblyInfo.cs. msbuild fails with:

            Properties\AssemblyInfo.cs(1,1): error CS0116: A namespace cannot directly contain members such as fields or methods

      I think it's a real question mark, not a unicode indicator.

      EDIT: Looking at the code, FilePath.readToString() and write() are used. According to the documentation, readToString() uses "current system encoding". For Windows, that is code page 932, aka windows-31j. However, my AssemblyInfo.cs files are UTF-8. I believe that Visual Studio uses UTF-8 by default. So perhaps the solution is to use core Java classes that can deal with different encodings. I am not a Java programmer, so I don't know what those would be.

      1. Unknown User (lkobus)

        Hi Andy, I created a Jira


        So you can folow to see when its fixed.

        Just as workaround u can change the encoding? I work with VS 2013 and didn't notice the problem, I gonna need some time to analyze.


        1. Unknown User (trampleduf)

          Thanks Leonardo, I changed the encoding and that did solve my problem for now.

          1. Unknown User (jenkinsnewbie)

            Hi Andy, Where and how did you change the encoding?

        2. Unknown User (pinkie)

          Is there any update on this? I am using VS2012 and my assemblyinfo.cs file was saved in UTF-8 by VS. After the plugin did it's work, the file has the leading '?' and was now encoded as ANSI. After forcing the source file to ANSI to begin with, the plugin worked correctly without adding in the '?'.

          Although this is a valid workaround, I had to remove some characters from my assemblyinfo.cs file in order to save it as ANSI (the copyright character) and would like to put it back.

  5. Unknown User (mausti)


    Can someone please provide a sample assemblyinfo.cs and Jenkins settings?

    To me it's unclear what placeholders to use and what Jenkins ssettings to use.



    1. Unknown User (lkobus)

      Mark are you new to Jenkins or just the plugin?

      The plugin by default is used to change assembly version from the original template that VS creates.

      If you have custom files you can use the regular expression to change the correct session of you version file.

      1. Unknown User (mausti)

        It's ok.  I resolved this in the end.  I thought that I would have to put some sort of place holder into the assemblyinfo.cs, but it seems I didn't.


        Unknown macro: {PIPELINE_VERSION}

        didn't work for me, but $

        Unknown macro: {BUILD_NUMBER}


        1. Unknown User (lkobus)

          Mark, that's because in the example PIPELINE_VERSION was a generated variable that other plugin create.
          You can use any variable that jenkins creates before the call of assembly version plugin.
          By default I think only build number was created by Jenkins, you can use others plugin to mix with this like : https://wiki.jenkins-ci.org/display/JENKINS/Version+Number+Plugin the generated version variable you can put to replace in assembly files, that was the purpose when I created that.

  6. Unknown User (aeroclassics)

    I must be slow but I am not getting anywhere with this. Could someone please kick back onto the correct path.

    Here is what I have configured..............

    Build Environment

    Create a formatted version number

    Environment Variable Name               $CURRENTBUILD
    Version Number Format String           1.0.$

    Unknown macro: {SVN_REVISION}


    Unknown macro: {BUILD_NUMBER}

    Prefix Variable                                   $CURRENTBUILD
    Failed Builds                                    Don't increment builds today/ this month/ this year/ all time after a failed build      
    Build Display Name                           Use the formatted version number for build display name.
    Project Start Date                             2014-06-11
    Number of builds today
    Number of builds this month
    Number of builds this year
    Number of builds since the start of the project

    I must not be understanding something. I would like the AssemblyVersion changed to what is in the Version Number Format String but that does not seem to be happening.

    Any and all help appreciated!


  7. Unknown User (zainzaman)

    Hi Mr.Kobus, 

    I've got this in a powershell script. 

    $assemblyPattern = "[0-9](\.([0-9]|*))

    Unknown macro: {1,3}

        $assemblyVersionPattern = 'AssemblyFileVersion("([0-9](\.([0-9]|*))

    $assemblyPattern = "[0-9](\.([0-9]|*))

    Unknown macro: {1,3}


    $assemblyVersionPattern = 'AssemblyFileVersion("([0-9](\.([0-9]|*))


    How do I put this info into the plugin? I think I might be messing with the syntax. Thanks 

    1. Unknown User (lkobus)

      Hi Zaman, let me see if i understand your problem.
      Are you using a powershell to update and now want to use the plugin?

      If yes than you REgex pattern you have to put on the "Regex Pattern option in the plugin" you dont need to use any powershell script to call the plugin.

      Is that what you want? if no can you explaint better what are you trying to do?

      [] ' s

  8. Unknown User (leslied)

    I'm trying to use this plug-in and when it modifies the AssemblyInfo.cs file, the first character in the edited file is '?' which causes the build to fail (for obvious reasons).  Any ideas why it is doing this?  I looked at the source code and it doesn't look like it should do this, so any thoughts would be appreciated.



    1. Unknown User (leslied)

      I found the answer to my problem in the issues list: Jenkins-25476

      The work-around is to save the Assembly file in UTF-8 (without BOM).

  9. Unknown User (yonnatan)

    Hello , 

    First of all i would like to thank the creator of this Plugin , it should resolve a lot of Versioning related issues i have ,

    The question is how do i set it up ?

    I would like the version to be for example 6.0.82.$

    Unknown macro: {Jenkins Build Number}

    how can i set it up  ?

    Thanks in advance  

    1. Unknown User (yonnatan)

      Ok , 

      It worked with  : 6.0.82.$

      Unknown macro: {BUILD_NUMBER}

      But the issue is that the files are imported from TFS with a "Read Only" Flag active , 

      So when trying to run the plugin i get : Finished getting version 'C52354'.
      Run condition [Always] enabling prebuild for step [BuilderChain]
      Run condition [Always] enabling perform for step [BuilderChain]
      Changing the file(s) D:\BuildAreas\Jen-Dev3\Source\GlobalAssemblyInfo.cs to version :
      java.io.IOException: Expecting Ant GLOB pattern, but saw 'D:\BuildAreas\Jen-Dev3\Source\GlobalAssemblyInfo.cs'. See http://ant.apache.org/manual/Types/fileset.html for syntax

      Any idea for a workaround or a solution for this issue?

  10. Unknown User (yonnatan)

    Ok , A Correction , I added a batch to remove the read-only flag and still getting the Error Above . 

    1. Unknown User (lkobus)

      Hi Yonnatan, let me see before call the plugin to update Assemblies files you have some routine that get files from TFS? 

      Didn't understand very well, is this what he write 'C52354' or you can't write anything?

      [] ' s

      1. Unknown User (yonnatan)

        Yes , i use TFS Plugin to Import the latest code from our TFS Source Control 

        The C52354 is generated automaticly by the TFS .



  11. Unknown User (sundancegomez)

    I am receiving:

    Updating file : D:\Jenkins\<PROJECT>\Properties\AssemblyInfo.csjava.io.FileNotFoundException: D:\Jenkins\MS-Main-CI\workspace\<PROJECT FOLDER>\Properties\AssemblyInfo.cs (Access is denied)
    at java.io.FileOutputStream.open(Native Method)

    Does the TFS build user need special access? Has anyone had this happen?

    1. Unknown User (sundancegomez)

      I figured it out. The TFS plug-in pulls files read-only (duh!) and I had to create a powershell script to set them as writable:

      AssemblyInfoFiles = Get-ChildItem -Filter 'AssemblyInfo.cs' -Recurse
      Foreach( $file in $AssemblyInfoFiles )
         if( $file.IsReadOnly )

      Unknown macro: {      $file.IsReadOnly = $false   }

      $AssemblyInfoFiles = Get-ChildItem -Filter 'AssemblyInfo.cs' -Recurse

      Foreach( $file in $AssemblyInfoFiles )


         if( $file.IsReadOnly )


      Unknown macro: {       $file.IsReadOnly = $false    }



      I think this can be changes to a one-line script, but I am leaving mine for reference. Thanks!

  12. Unknown User (andrey_marchuk)

    Nice plugin, thanks. It would be very nice if the build number could be used as a source for the Token Macro Plugin

    This way you could see what build number are you using (both major and minor version) in the same place, right on the main page of your build plan

  13. Unknown User (vandan)


    is it possible to use this plugin in a Jenkins 2.0 Pipeline Jenkinsfile?

    If not, are there any plans to implement this?

  14. Unknown User (cragdor)

    I have downloaded and installed the 1.5.1 version of the plugin and I have an issue in that it is putting a question mark as the first character in the file, causing my builds to fail.

    Is this a bug in the software or how I have it setup?


    1. Unknown User (dmgambone)

      I am also seeing this issue.  I installed 1.5.1 on a new jenkins environment (version 2.32.2), where my old jenkins environment had 1.5.1 and is Jenkins version 1.644.  The old Jenkins version does not have this issue, but the 2.32.2 does.

      Builds fail due to a ? being inserted at the beginning of the file

      What is different between the two (other than version) is that the newer setup has Jenkins running on Linux, but executing builds on Windows.  The older version is a single instance Jenkins where Jenkins and builds occur on the same instance.

  15. Unknown User (tzadikv)

  16. Unknown User (felipeleite)

    Hi Leonardo,

    I want to use the ${RELEASE_VERSION} to be changed at the Assembly file but only work when a Release is build. If I try a common Build, the plugin crash.

     I think could be a option like, I "declare" some VARS separated by ';' and the plugin uses the first one founded.


    So, the plugin try the BUILD_NUMBER, if is a empty VAR, try the next on which is RELEASE_VERSION ....

  17. Unknown User (justinnimmo)

    I have version 1.5.1 installed and am running into an issue where one file is getting updated but another is not even though the logs say both files are updated. 



    1. Unknown User (justinnimmo)

      Removed Stack Overflow and added bug  JENKINS-48641 - Getting issue details... STATUS

    2. Unknown User (justinnimmo)

      I solved my own issue.  There was a slight difference between files that I didn't notice for far too long.

  18. Unknown User (bucherb)

    The lastest version (1.10) broke backward compatibility with existing build's configuration. Nothing is changed in AssemblyInfo.cs

    Here is the output of a test project

    Changing File(s): **/AssemblyInfo.cs
    Assembly Version :
    Assembly Title : 
    Assembly Description : 
    Assembly Company : 
    Assembly Product : 
    Assembly Copyright : 
    Assembly Trademark : 
    Assembly Culture : 
    Updating file : C:\Jenkins\workspace\Test\AssemblyInfo.cs, Replacement :
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    Skipping replacement because value is empty.
    1. Unknown User (bucherb)

      Got scared by the messages but values ARE changed. Sorry for the false alarm (and the spam)

  19. Unknown User (ashish_kataria)

    Is there a way to do this for AssemblyInfo.cpp files? I tried setting the File Name to **/AssemblyInfo.cpp and the Console Output shows that the file got picked up but the change did not happen.


    I think it is due to the extra "Attribute" suffix with the properties that only AssemblyInfo.cpp files have.

    1. Unknown User (justinnimmo)

      I ran into an issue where some files weren't getting changed if the following two lines weren't in the file at all.  Try adding them and then running it again.

      [assembly: AssemblyVersion("")]
      [assembly: AssemblyFileVersion("")]

  20. Unknown User (diewuq)


    I ran this plugin with version 1.10, and jenkins version is 2.89.4, it turn out to be with error “java.lang.IlleagalArgumentException: named capturing group is missing trailing '}' "  ,  with change-assembly-version-plugin 1.5.1, it's ok.

    Can you please look into it?

    Thanks in advance.