[Bug] GitVersion.MsBuild produces extra files
See original GitHub issueDescribe the bug
GitVersion.MsBuild produces files called gitversion.json
in each project directory. Thus, a .gitignore entry is in order for those using this, which is a little annoying. GitVersionTask did not have this issue.
For context, I am using Paket, so I do a paket restore
before building with msbuild
.
Expected Behavior
Run a build and have no unexpected side-effects.
Actual Behavior
Ran a build and got several files showing up as changes in git.
Context
I am wanting to upgrade from the deprecated GitVersionTask
to the more up-to-date GitVersion.MsBuild
so that the version of it can keep up with the executable distribution, to help isolate build issues.
Your Environment
OS: Windows 10 Project Target: net462 Visual Studio Version: 2019 16.8.4 Paket Version: 5.257.0 GitVersion.MsBuild Version: 5.6.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (7 by maintainers)
I had the same problem, I change the order of the GitVersion.MsBuild.props’s import in my csproj.
So I put the line :
<Import Project="packages\GitVersion.MsBuild.5.6.6\build\GitVersion.MsBuild.props" Condition="Exists('packages\GitVersion.MsBuild.5.6.6\build\GitVersion.MsBuild.props')" />
After the line :<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Now, the gitversion.json is produced in the obj folder for my project.
I can try.