Skip to content
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

Closed
2 tasks done
junlinz2 opened this issue Jul 15, 2024 · 3 comments · Fixed by #4111
Closed
2 tasks done
Milestone

Comments

@junlinz2
Copy link

junlinz2 commented Jul 15, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

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:

  • We do not have concurrent project builds - all build servers only build one project at a time (but for multiple target frameworks)
  • The first write of the gitversion.properties file works, but then due to the behaviour above the subsequent write to the file fails.
  • All build pipelines are run from empty workspace folders and NuGet environment variables are set to paths within said workspace folder:
    • NUGET_PACKAGES
    • NUGET_HTTP_CACHE_PATH
    • NUGET_SCRATCH
    • NUGET_PLUGIN_CACHE_PATH

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.

dotnet new console --name gv-proj; cd gv-proj

# Edit <TargetFramework> here to become <TargetFrameworks> and add a new target framework, eg: net8.0-ios
vim gv-proj.csproj 

# Add GitVersion.MSBuild 5.12.*
dotnet add gv-proj.csproj package GitVersion.MSBuild --version "5.12.*"

# Set up a basic git repo
git init; git add .; git commit -am "Initial commit"; git tag 1.0
git remote add origin [email protected]:user/myrepo.git
git push -u origin main; git push origin 1.0

# touch and tail the gitversion.properties file
touch gitversion.properties && tail -f gitversion.properties

# In another window, cd to the project and build it while simulating a Jenkins environment
JENKINS_URL="http://jenkins" CI=1 WORKSPACE=$(PWD) dotnet build --configuration Debug --no-incremental -v:normal /p:ApplicationId=com.sample.mysampleapp

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).

RunGitVersion:
         dotnet --roll-forward Major "/Users/xyz/.nuget/packages/gitversion.msbuild/5.12.0/tools/netcoreapp3.1/gitversion.dll" "/Users/xyz/Desktop/gv-testing"  -output file -outputfile obj/gitversion.json
     1>WriteVersionInfoToBuildLog:
         Executing GenerateBuildLogOutput for 'Jenkins'.


         GitVersion_Major=1


         GitVersion_Minor=0


         GitVersion_Patch=0


         GitVersion_PreReleaseTag=


         GitVersion_PreReleaseTagWithDash=


         GitVersion_PreReleaseLabel=


         GitVersion_PreReleaseLabelWithDash=


         GitVersion_PreReleaseNumber=


         GitVersion_WeightedPreReleaseNumber=60000


         GitVersion_BuildMetaData=


         GitVersion_BuildMetaDataPadded=


         GitVersion_FullBuildMetaData=Branch.main.Sha.d9373b10350948eac153394db6733005d377315b


         GitVersion_MajorMinorPatch=1.0.0


         GitVersion_SemVer=1.0.0


         GitVersion_LegacySemVer=1.0.0


         GitVersion_LegacySemVerPadded=1.0.0


         GitVersion_AssemblySemVer=1.0.0.0


         GitVersion_AssemblySemFileVer=1.0.0.0


         GitVersion_FullSemVer=1.0.0


         GitVersion_InformationalVersion=1.0.0+Branch.main.Sha.d9373b10350948eac153394db6733005d377315b


         GitVersion_BranchName=main


         GitVersion_EscapedBranchName=main


         GitVersion_Sha=d9373b10350948eac153394db6733005d377315b


         GitVersion_ShortSha=d9373b1


         GitVersion_NuGetVersionV2=1.0.0


         GitVersion_NuGetVersion=1.0.0


         GitVersion_NuGetPreReleaseTagV2=


         GitVersion_NuGetPreReleaseTag=


         GitVersion_VersionSourceSha=d9373b10350948eac153394db6733005d377315b


         GitVersion_CommitsSinceVersionSource=0


         GitVersion_CommitsSinceVersionSourcePadded=0000


         GitVersion_UncommittedChanges=149


         GitVersion_CommitDate=2024-07-12


         Outputting variables to 'gitversion.properties' ...


       UpdateAssemblyInfo:
         2024-07-15 11:45:09            INFO [07/15/24 11:45:09:34] Updating assembly info files

         2024-07-15 11:45:09            INFO [07/15/24 11:45:09:34] Found 1 files

       _GenerateSourceLinkFile:
         Source Link is empty, file 'obj/Debug/net8.0/gv-proj.sourcelink.json' does not exist.
       CoreCompile:
         /usr/local/share/dotnet/dotnet exec "/usr/local/share/dotnet/sdk/8.0.201/Roslyn/bincore/csc.dll" /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:8 /define:TRACE;DEBUG;NET;NET8_0;NETCOREAPP;NET5_0_OR_GREATER;NET6_0_OR_GREATER;NET7_0_OR_GREATER;NET8_0_OR_GREATER;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2_OR_GREATER;NETCOREAPP3_0_OR_GREATER;NETCOREAPP3_1_OR_GREATER /highentropyva+ /nullable:enable /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/Microsoft.CSharp.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/Microsoft.VisualBasic.Core.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/Microsoft.VisualBasic.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/Microsoft.Win32.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/Microsoft.Win32.Registry.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/mscorlib.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/netstandard.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.AppContext.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Buffers.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Collections.Concurrent.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Collections.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Collections.Immutable.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Collections.NonGeneric.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Collections.Specialized.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.Annotations.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.DataAnnotations.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.EventBasedAsync.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ComponentModel.TypeConverter.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Configuration.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Console.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Core.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Data.Common.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Data.DataSetExtensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Data.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.Contracts.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.Debug.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.DiagnosticSource.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.FileVersionInfo.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.Process.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.StackTrace.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.TextWriterTraceListener.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.Tools.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.TraceSource.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Diagnostics.Tracing.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Drawing.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Drawing.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Dynamic.Runtime.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Formats.Asn1.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Formats.Tar.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Globalization.Calendars.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Globalization.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Globalization.Extensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Compression.Brotli.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Compression.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Compression.FileSystem.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Compression.ZipFile.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.FileSystem.AccessControl.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.FileSystem.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.FileSystem.DriveInfo.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.FileSystem.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.FileSystem.Watcher.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.IsolatedStorage.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.MemoryMappedFiles.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Pipes.AccessControl.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.Pipes.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.IO.UnmanagedMemoryStream.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Linq.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Linq.Expressions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Linq.Parallel.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Linq.Queryable.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Memory.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Http.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Http.Json.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.HttpListener.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Mail.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.NameResolution.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.NetworkInformation.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Ping.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Quic.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Requests.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Security.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.ServicePoint.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.Sockets.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.WebClient.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.WebHeaderCollection.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.WebProxy.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.WebSockets.Client.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Net.WebSockets.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Numerics.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Numerics.Vectors.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ObjectModel.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.DispatchProxy.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Emit.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Emit.ILGeneration.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Emit.Lightweight.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Extensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Metadata.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Reflection.TypeExtensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Resources.Reader.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Resources.ResourceManager.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Resources.Writer.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.CompilerServices.Unsafe.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.CompilerServices.VisualC.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Extensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Handles.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.InteropServices.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.InteropServices.JavaScript.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.InteropServices.RuntimeInformation.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Intrinsics.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Loader.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Numerics.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Serialization.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Serialization.Formatters.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Serialization.Json.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Serialization.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Runtime.Serialization.Xml.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.AccessControl.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Claims.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.Algorithms.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.Cng.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.Csp.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.Encoding.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.OpenSsl.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.Primitives.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Cryptography.X509Certificates.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Principal.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.Principal.Windows.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Security.SecureString.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ServiceModel.Web.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ServiceProcess.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.Encoding.CodePages.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.Encoding.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.Encoding.Extensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.Encodings.Web.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.Json.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Text.RegularExpressions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Channels.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Overlapped.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Tasks.Dataflow.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Tasks.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Tasks.Extensions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Tasks.Parallel.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Thread.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.ThreadPool.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Threading.Timer.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Transactions.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Transactions.Local.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.ValueTuple.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Web.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Web.HttpUtility.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Windows.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.Linq.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.ReaderWriter.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.Serialization.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.XDocument.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.XmlDocument.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.XmlSerializer.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.XPath.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/System.Xml.XPath.XDocument.dll /reference:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/ref/net8.0/WindowsBase.dll /debug+ /debug:portable /filealign:512 /optimize- /out:obj/Debug/net8.0/gv-proj.dll /refout:obj/Debug/net8.0/refint/gv-proj.dll /target:exe /warnaserror- /utf8output /deterministic+ /langversion:12.0 /analyzerconfig:obj/Debug/net8.0/gv-proj.GeneratedMSBuildEditorConfig.editorconfig /analyzerconfig:/usr/local/share/dotnet/sdk/8.0.201/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_8_default.globalconfig /analyzer:/usr/local/share/dotnet/sdk/8.0.201/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll /analyzer:/usr/local/share/dotnet/sdk/8.0.201/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/Microsoft.Interop.ComInterfaceGenerator.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/Microsoft.Interop.JavaScript.JSImportGenerator.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/Microsoft.Interop.LibraryImportGenerator.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/Microsoft.Interop.SourceGeneration.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.dll /analyzer:/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.2/analyzers/dotnet/cs/System.Text.RegularExpressions.Generator.dll Program.cs obj/Debug/net8.0/gv-proj.GlobalUsings.g.cs "obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs" obj/Debug/net8.0/GitVersionInformation.g.cs obj/Debug/net8.0/AssemblyInfo.g.cs obj/Debug/net8.0/gv-proj.AssemblyInfo.cs /warnaserror+:NU1605,SYSLIB0011
         CompilerServer: server - server processed compilation - 40d45d5c-396f-4a40-a49a-95f37ed6fb16
       _CopyOutOfDateSourceItemsToOutputDirectory:
         Copying file from "/Users/xyz/Desktop/gv-testing/obj/Debug/net8.0/apphost" to "/Users/xyz/Desktop/gv-testing/bin/Debug/net8.0/gv-proj".
       CopyFilesToOutputDirectory:
         Copying file from "/Users/xyz/Desktop/gv-testing/obj/Debug/net8.0/gv-proj.dll" to "/Users/xyz/Desktop/gv-testing/bin/Debug/net8.0/gv-proj.dll".
         Copying reference assembly from "obj/Debug/net8.0/refint/gv-proj.dll" to "/Users/xyz/Desktop/gv-testing/obj/Debug/net8.0/ref/gv-proj.dll".
         gv-proj -> /Users/xyz/Desktop/gv-testing/bin/Debug/net8.0/gv-proj.dll
         Copying file from "/Users/xyz/Desktop/gv-testing/obj/Debug/net8.0/gv-proj.pdb" to "/Users/xyz/Desktop/gv-testing/bin/Debug/net8.0/gv-proj.pdb".
     1>Done Building Project "/Users/xyz/Desktop/gv-testing/gv-proj.csproj" (Build target(s)).
     1>WriteVersionInfoToBuildLog:
         Executing GenerateBuildLogOutput for 'Jenkins'.


         GitVersion_Major=1


         GitVersion_Minor=0


         GitVersion_Patch=0


         GitVersion_PreReleaseTag=


         GitVersion_PreReleaseTagWithDash=


         GitVersion_PreReleaseLabel=


         GitVersion_PreReleaseLabelWithDash=


         GitVersion_PreReleaseNumber=


         GitVersion_WeightedPreReleaseNumber=60000


         GitVersion_BuildMetaData=


         GitVersion_BuildMetaDataPadded=


         GitVersion_FullBuildMetaData=Branch.main.Sha.d9373b10350948eac153394db6733005d377315b


         GitVersion_MajorMinorPatch=1.0.0


         GitVersion_SemVer=1.0.0


         GitVersion_LegacySemVer=1.0.0


         GitVersion_LegacySemVerPadded=1.0.0


         GitVersion_AssemblySemVer=1.0.0.0


         GitVersion_AssemblySemFileVer=1.0.0.0


         GitVersion_FullSemVer=1.0.0


         GitVersion_InformationalVersion=1.0.0+Branch.main.Sha.d9373b10350948eac153394db6733005d377315b


         GitVersion_BranchName=main


         GitVersion_EscapedBranchName=main


         GitVersion_Sha=d9373b10350948eac153394db6733005d377315b


         GitVersion_ShortSha=d9373b1


         GitVersion_NuGetVersionV2=1.0.0


         GitVersion_NuGetVersion=1.0.0


         GitVersion_NuGetPreReleaseTagV2=


         GitVersion_NuGetPreReleaseTag=


         GitVersion_VersionSourceSha=d9373b10350948eac153394db6733005d377315b


         GitVersion_CommitsSinceVersionSource=0


         GitVersion_CommitsSinceVersionSourcePadded=0000


         GitVersion_UncommittedChanges=149


         GitVersion_CommitDate=2024-07-12


         Outputting variables to 'gitversion.properties' ...


       UpdateAssemblyInfo:
         2024-07-15 11:45:09            INFO [07/15/24 11:45:09:55] Updating assembly info files

         2024-07-15 11:45:09            INFO [07/15/24 11:45:09:55] Found 1 files
@arturcic
Copy link
Member

You're using version 5.12, can you also try version 6.0.0-rc.2 and see it it reproduces?

@junlinz2
Copy link
Author

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 net8.0-ios target framework. The build works with the net8.0 target framework (the first one defined in my csproj).:

"/Users/xyz/Desktop/gv-testing/gv-proj.csproj" (Rebuild target) (1:15) ->
       "/Users/xyz/Desktop/gv-testing/gv-proj.csproj" (Build target) (1:19) ->
       (RunGitVersion target) -> 
         /Users/xyz/.nuget/packages/gitversion.msbuild/6.0.0-rc.2/tools/GitVersion.MsBuild.targets(21,9): error MSB3073: The command "dotnet --roll-forward Major "/Users/xyz/.nuget/packages/gitversion.msbuild/6.0.0-rc.2/tools/net8.0-ios/gitversion.dll" "/Users/xyz/Desktop/gv-testing"  -output file -outputfile "obj/gitversion.json"" exited with code 1. [/Users/xyz/Desktop/gv-testing/gv-proj.csproj::TargetFramework=net8.0-ios]

    1 Warning(s)
    1 Error(s)

This seems to be because the command it's trying to run references a gitversion.dll that does not exist:

% dotnet --roll-forward Major "/Users/xyz/.nuget/packages/gitversion.msbuild/6.0.0-rc.2/tools/net8.0-ios/gitversion.dll" "/Users/xyz/Desktop/gv-testing"  -output file -outputfile "obj/gitversion.json"

Could not execute because the specified command or file was not found.
....
% ls $HOME/.nuget/packages/gitversion.msbuild/6.0.0-rc.2/tools
GitVersion.MsBuild.props   GitVersion.MsBuild.targets net6.0                     net7.0                     net8.0

@arturcic arturcic added this to the 6.x milestone Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit to arturcic/GitVersion that referenced this issue Jul 23, 2024
arturcic added a commit that referenced this issue Jul 23, 2024
#4093 - allow to override the TargetFramework
@arturcic arturcic modified the milestones: 6.x, 6.0.1 Aug 5, 2024
@arturcic
Copy link
Member

arturcic commented Aug 5, 2024

🎉 This issue has been resolved in version 6.0.1 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants