Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36375

Change assembly version is adding ? char at the beginning of the AssemblyInfo.cs

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • master Linux, Slave: windows
      Jenkins ver. 2.11

      The plugin is adding a "?" char to all AssemblyInfo.cs files,
      Ex.
      ?using System.Reflection;
      using System.Runtime.CompilerServices;
      using System.Runtime.InteropServices;

      // General Information about an assembly is controlled through the following
      // set of attributes. Change these attribute values to modify the information

      It do change the assembyVersion line correctly
      [assembly: AssemblyVersion("4.6.7.1")]

      But the build is failing because the ? at the beginning of the file

          [JENKINS-36375] Change assembly version is adding ? char at the beginning of the AssemblyInfo.cs

          Steph B added a comment - - edited

          Same issue here.
          Solution can't be built due this extra '?' char.

          change-assembly-version-plugin 1.5.1
          Windows Server 2012 R2 build slave

          Steph B added a comment - - edited Same issue here. Solution can't be built due this extra '?' char. change-assembly-version-plugin 1.5.1 Windows Server 2012 R2 build slave

          simon so added a comment -

          Same here

          change-assembly-version-plugin 1.5.1
          Slave
          Windows 10 build node

          simon so added a comment - Same here change-assembly-version-plugin 1.5.1 Slave Windows 10 build node

          Steph B added a comment -

          Don't know why it's so long for a fix !
          Here a small workaround :

          • use the plugin as is.
          • to remove the extra character i use the following job step :
            Execute Window Batch command :
            for /f %%f in ('dir /s /b AssemblyInfo.cs') do sed -i '1s/.//' %%f

          Then the build is OK.
          Hope it will help.

          Regards.

          Steph B added a comment - Don't know why it's so long for a fix ! Here a small workaround : use the plugin as is. to remove the extra character i use the following job step : Execute Window Batch command : for /f %%f in ('dir /s /b AssemblyInfo.cs') do sed -i '1s/.//' %%f Then the build is OK. Hope it will help. Regards.

          tjormola added a comment -

          tjormola added a comment - Proposed fix at https://github.com/jenkinsci/change-assembly-version-plugin/pull/10

          Connor P added a comment - - edited

          Had the same issue on plugin version 1.5.1, Windows Server 2012 R2 build slave.

          Here's a variant workaround with no external dependencies (e.g. sed). Worked on Windows Server 2012 R2.

          Windows Powershell

          gci -recurse -filter "AssemblyInfo.cs" | %{ (gc $_.fullname) -replace '\?' | Set-content $_.fullname }
          

          Connor P added a comment - - edited Had the same issue on plugin version 1.5.1, Windows Server 2012 R2 build slave. Here's a variant workaround with no external dependencies (e.g. sed). Worked on Windows Server 2012 R2. Windows Powershell gci -recurse -filter "AssemblyInfo.cs" | %{ (gc $_.fullname) -replace '\?' | Set-content $_.fullname }

          Blair Stewart added a comment -

          This is still a problem, thank you cpozdolski your solution saved me!

          Blair Stewart added a comment - This is still a problem, thank you cpozdolski your solution saved me!

          The character you are seeing is the UTF-8 BOM.  This is caused by a bug in Visual Studio. See: https://developercommunity.visualstudio.com/content/problem/28254/visual-studio-writes-bom-for-utf8-files.html .  Seems like it is fixed by an update.

          Tzadik Vanderhoof added a comment - The character you are seeing is the UTF-8 BOM.  This is caused by a bug in Visual Studio. See: https://developercommunity.visualstudio.com/content/problem/28254/visual-studio-writes-bom-for-utf8-files.html .  Seems like it is fixed by an update.

          Tzadik Vanderhoof added a comment - - edited

          There is already a pull request against the plugin that fixes this but it was rejected with no explanation:

          https://github.com/jenkinsci/change-assembly-version-plugin/pull/11

          Tzadik Vanderhoof added a comment - - edited There is already a pull request against the plugin that fixes this but it was rejected with no explanation: https://github.com/jenkinsci/change-assembly-version-plugin/pull/11

          Debbie Wright added a comment -

          Is there a plan to Fix this? with workaround works, Its just cumbersome

          Debbie Wright added a comment - Is there a plan to Fix this? with workaround works, Its just cumbersome

          This was merged as part of https://github.com/jenkinsci/change-assembly-version-plugin/pull/11. Now we just need to wait for the next release. Probably v1.11

          Hector Santana added a comment - This was merged as part of https://github.com/jenkinsci/change-assembly-version-plugin/pull/11.  Now we just need to wait for the next release. Probably v1.11

            sankethpb Sanketh PB
            eyzenm Eyzen M. Kim
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: