Repository navigation
[ISSUE]: gitversion.msbuild v6.0.1 breaks build #4140
Description
Activity
Please post here the csproj file, just remove the not relevant parts
Sure, here is the entire thing:
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> <UserSecretsId>aspnet-PMCM.BlazorApp-BC9E0918-B82F-462E-9A88-553DA00F706E</UserSecretsId> <RootNamespace>PMCM.BlazorApp</RootNamespace> </PropertyGroup> <ItemGroup> <PackageReference Include="AspNetCore.SassCompiler" Version="1.77.8"> <PrivateAssets>all</PrivateAssets> </PackageReference> <PackageReference Include="AsyncAwaitBestPractices" Version="8.0.0" /> <PackageReference Include="Ben.Demystifier" Version="0.4.1" /> <PackageReference Include="BitzArt.Blazor.Auth.Server" Version="1.0.0" /> <PackageReference Include="Blazored.FluentValidation" Version="2.2.0" /> <PackageReference Include="Blazored.Toast" Version="4.2.1" /> <PackageReference Include="ByteSize" Version="2.1.2" /> <PackageReference Include="csvhelper" Version="33.0.1" /> <PackageReference Include="Exceptionless.AspNetCore" Version="6.0.4" /> <PackageReference Include="Extensions.FluentValidation.Br" Version="1.0.2" /> <PackageReference Include="GitVersion.MsBuild" Version="6.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Humanizer.Core.pt" Version="2.14.1" /> <PackageReference Include="JetBrains.Annotations" Version="2024.2.0" /> <PackageReference Include="Microcharts" Version="0.9.5.9" /> <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" /> <PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" /> <PackageReference Include="MediatR" Version="12.4.0" /> <PackageReference Include="MudBlazor" Version="7.5.0" /> <PackageReference Include="NodaTime" Version="3.1.11" /> <PackageReference Include="QuestPDF" Version="2024.7.2" /> <PackageReference Include="RavenDB.Client" Version="6.0.105" /> <PackageReference Include="Rollbar" Version="5.2.2" /> <PackageReference Include="SendGrid" Version="9.29.3" /> <PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.1" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" /> <PackageReference Include="Serilog.AspNetCore" Version="8.0.2" /> <PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" /> <PackageReference Include="Serilog.Exceptions" Version="8.4.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="8.0.2" /> <PackageReference Include="Serilog.Sinks.Exceptionless" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.Loggly" Version="5.4.0" /> <PackageReference Include="Serilog.Sinks.RavenDB" Version="3.0.0" /> <PackageReference Include="Serilog.Sinks.RollbarCom" Version="1.0.4" /> <PackageReference Include="TypeMember" Version="1.0.0" /> <PackageReference Include="SkiaSharp" Version="2.88.8" Condition="$(RuntimeIdentifier.Contains('win-x')) == false" /> <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" Condition="$(RuntimeIdentifier.Contains('win-x')) == false" /> <PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="7.3.0.2" Condition="$(RuntimeIdentifier.Contains('win-x')) == false" /> </ItemGroup> <Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Exec Command="echo OS: $(OS)" /> <Exec Command="echo RuntimeIdentifier: $(RuntimeIdentifier)" /> <Exec Command="echo Publish Linux runtime dependencies: $(RuntimeIdentifier.StartsWith('win-x').Equals(False))" /> <Exec Command="echo;" /> </Target> <Target Name="QuestPDF_DoNotIncludeLatoFont_AfterBuild" AfterTargets="Build"> <RemoveDir Directories="$(OutDir)/LatoFont" /> </Target> <Target Name="QuestPDF_DoNotIncludeLatoFont_AfterPublish" AfterTargets="Publish"> <RemoveDir Directories="$(PublishDir)/LatoFont" /> </Target> <ItemGroup> <None Update="Core\Certificate\db.pfx"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> <ItemGroup> <Folder Include="Core\Certificate\" /> <Content Remove="Core\Logging\logs\**" /> <Content Remove="wwwroot\lib\**" /> <Folder Include="wwwroot\Upload\Logo\" /> <Content Remove="wwwroot\Upload\Temp\**" /> <Content Remove="wwwroot\Upload\Logo\custom-logo.png" /> <None Update="Data\Certificate\db.pfx"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <Content Include="wwwroot\lib\**\*.min.js"> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </Content> <Content Include="wwwroot\lib\**\*.min.css"> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </Content> <Content Include="wwwroot\lib\**\*.map"> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </Content> <Content Include="wwwroot\lib\**\*.woff"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="wwwroot\lib\**\*.woff2"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Remove="wwwroot\lib\\bootstrap\dist\css\*.rtl.*" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\RavenDB.Identity\RavenDB.Identity.csproj" /> </ItemGroup> <ItemGroup> <_ContentIncludedByDefault Remove="Core\Logging\logs\buffer-20240619.json" /> </ItemGroup> </Project>
Same here.
/home/runner/.nuget/packages/gitversion.msbuild/6.0.1/tools/GitVersion.MsBuild.targets(18,9): error MSB3073: The command "dotnet --roll-forward Major "/home/runner/.nuget/packages/gitversion.msbuild/6.0.1/tools/gitversion.dll" "/home/runner/work/NHibernate.DuckDB/NHibernate.DuckDB/src/NHibernate.DuckDB" -output file -outputfile "obj/gitversion.json"" exited with code 1. [/home/runner/work/NHibernate.DuckDB/NHibernate.DuckDB/src/NHibernate.DuckDB/NHibernate.DuckDB.csproj]
The Directory.Build.props file: https://github.com/hazzik/NHibernate.DuckDB/blob/33c577cd97b79ee23d88750b88661390c4fd40cf/src/Directory.Build.props
Also, it was failing in 6.0.0 as well.
Same with us. But it was related to our global.json in projects which had pinned the dotnet version to latestFeature instead of latestMajor which would have allowed this operation to succeed.
{ "sdk": { "version": "8.0.100", "rollForward": "latestFeature" } }from my testing the problem seems to be that the targetframework specifier is missing from the dll path. In my case the command that is executed is
dotnet --roll-forward Major "C:\Users\seubert\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll" "<project>" -output file -outputfile "<project>\gitversion.json". The pathC:\Users\seubert\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dlldoes not point to a dll because the target framework is missing.This might be caused by #4093 because there the TargetFramework is made overrideable. But this will cause problems because of the evaluation order in which the props/targets are evaluated. This is because the
<TargetFramework>might be null at the evaluation time of thesrc/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.propsbecause it is set later in the evaluation chain of the sdk.@Louis9902 good catch, I think when I moved the props to the
.propsfile I forgot about this nuance- linked a pull request that will close this issuemove msbuild properties default evaluation to targets file #4142
on Aug 6, 2024 🎉 This issue has been resolved in version 6.0.2 🎉
The release is available on:Your GitReleaseManager bot 📦🚀
Reacted by Luis Fernando de Souza SantosReacted by Luis Fernando de Souza Santos
Prerequisites
GitVersion package
GitVersion.MsBuild
GitVersion version
gitversion.msbuild v6.0.1
Operating system
Windows
What are you seeing?
dotnet buildis falling.What is expected?
A build success.
Steps to Reproduce
Just upgrade from gitversion.msbuild v6.0.0 to v6.0.1 and try
dotnet buildThe TargetFramework is
net8.0RepositoryFixture Test
none
Output log or link to your CI build (if appropriate).