question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] GitVersion.MsBuild produces extra files

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
GillesBricecommented, Feb 18, 2021

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.

0reactions
chrbkrcommented, Feb 18, 2021

I can try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitVersionTask v4 with an MSBuild-only project
I assume the error must have something to do with this not being a normal .NET project (i.e., with no source code aside...
Read more >
GitVersion.MsBuild Auto Increment? : r/dotnet
It sounds like the current version will simply be injected on build, so it will appear in the EXE/DLL's file properties, and there...
Read more >
MSBuild Task
MsBuild — is a simple solution if you want to version your assemblies without writing any command line scripts or modifying your build...
Read more >
Azure DevOps
The custom build step requires a one-time setup to import the GitVersion task into your TFS or Azure DevOps Pipeline instance. Executing GitVersion....
Read more >
GitVersion.MSBuild error - Build/Test Issues
Let me clarify. I believe that GitVersion is _generating_ that file, not looking for it. The error is that its a malformed path...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found