Skip to content

[Bug] /updatewixversionfile does not cleanly recreate the file #2257

@tcs-devel

Description

@tcs-devel

The content of the file GitVersion_WixVersion.wxi is not fully overwritten/recreated when the file already exists and GitVersion /updatewixversionfile is invoked. Instead it just overwrites the first x bytes.

Expected Behavior

The entire content of GitVersion_WixVersion.wxi is overwritten and the file has a valid content afterwards.

Actual Behavior

If the existing file is larger than the newly generated file, parts of the previously existing content remain in the file.

Possible Fix

Delete the file prior writing/correctly write the content.

Steps to Reproduce

  1. Create a large dummy file called GitVersion_WixVersion.wxiin the root of a repo.
  2. Run GitVersion /updatewixversionfile
  3. After that, the file looks like this (shortend the wix related content):
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define AssemblySemFileVer="2.0.0.0"?>
  <?define AssemblySemVer="2.0.0.0"?>
  ...
  <?define WeightedPreReleaseNumber="30001"?>
</Include>ignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 

Your Environment

  • Version Used: 5.3.2+Branch.master.Sha.438d45004092e2f6b9aa4d12b07c64becfff4031 (also in 5.2.4)
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions