-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE]: gitversion.properties is written to more than once when TargetFrameworks
is supplied in .csproj
#4093
Comments
You're using version 5.12, can you also try version 6.0.0-rc.2 and see it it reproduces? |
Thanks for your response. I updated my MSBuild tool to 6.0.0-rc.2, when I attempt to build using the same build commands I get a build failure when it attempts to build for the
This seems to be because the command it's trying to run references a gitversion.dll that does not exist:
|
#4093 - allow to override the TargetFramework
🎉 This issue has been resolved in version 6.0.1 🎉 Your GitReleaseManager bot 📦🚀 |
Prerequisites
GitVersion package
GitVersion.MsBuild
GitVersion version
5.12
Operating system
Windows, macOS
What are you seeing?
When running .NET builds in a Jenkins environment, the gitversion.properties file is re-written to multiple times, according to how many target frameworks are specified. I believe it should only be written to once as my impression is that GitVersion information is unique to the Git repo overall, and not specific to the target framework being built.
This might be the cause of the issue #3737 that I previously found as Windows is much more restrictive with files being written to concurrently. To address the concerns in #3737 (comment) and to add some info on our setup:
What is expected?
gitversion.properties file should only be written to once, regardless of how many
TargetFrameworks
there are. So if this file did not exist (which should be the case with a clean build anyway), any concurrency that .NET might have with building the project for multiple target frameworks should not cause the build to fail due to repeated attempts to write to the same file.If GitVersion information did somehow differ between target frameworks, the build process should write different properties files to avoid the possibility of this information being overwritten by the next target framework build.
Steps to Reproduce
Tested this issue on macOS to utilise the
tail -f
command, however in Windows build log it is also evident when using-v: normal
that the gitversion.properties file is written to more than once.Result:
1>WriteVersionInfoToBuildLog
is performed twice. In the window where gitversion.properties is being tailed, the gitversion variables are printed twice, indicating that this file has been overwritten during the build process.RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The text was updated successfully, but these errors were encountered: