GitInfo
GitInfo copied to clipboard
Version issue with Multi-target projects
If I have a normal project that only targets one framework, and I define the following target in its .csproj
file:
<Target Name="PopulateNETSDKAssemblyVersion" AfterTargets="_GitPopulateVersionInfo">
<PropertyGroup>
<Version>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch).0</Version>
<FileVersion>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch).$(GitCommits)</FileVersion>
<PackageVersion>$(FileVersion)</PackageVersion>
<InformationalVersion>$(FileVersion)+branch.$(GitBranch).commit.$(GitCommit)</InformationalVersion>
</PropertyGroup>
<Message Importance="high" Text="PackageVersion: $(PackageVersion)" />
</Target>
Everything works - when packing the version it's correct. But once we move to a multi-target project, this doesn't do anything.