GuardClauses icon indicating copy to clipboard operation
GuardClauses copied to clipboard

Fix Build

Open ardalis opened this issue 1 year ago • 1 comments
trafficstars

I think this is due to multi-targeting.

https://github.com/ardalis/GuardClauses/actions/runs/7564844299/job/20599626486?pr=335

Need to set a value in the build - not sure where/how. Will look into it soon but this is blocking the new release going out.

ardalis avatar Jan 18 '24 03:01 ardalis

The error you're encountering is thrown on line 62 of the following project you're using: https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/blob/master/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets It's not entirely clear to me why, since you set the requested property here: https://github.com/ardalis/GuardClauses/blob/main/Directory.Build.props Maybe the build process isn't picking up the latter file?

OttoHein avatar Jan 31 '24 13:01 OttoHein

@ardalis I guess you're referring to the error message: "RA0001 There is more than one PackageDownload of Microsoft.NETCore.App.Ref"

After sneaking into other repos, I found this workaround:

<ItemGroup>
  <PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" />
  <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
                                                               <!-- ^^^^^^  -->
</ItemGroup>

<PropertyGroup>
  <AnnotatedReferenceAssemblyVersion>3.1.0</AnnotatedReferenceAssemblyVersion>
</PropertyGroup>
<!-- ^^^^^^  -->

Not sure if that's the official fix. But it worked on my machine 😄

canro91 avatar Jul 01 '24 18:07 canro91

Can you send a PR, @canro91 ?

ardalis avatar Jul 02 '24 14:07 ardalis

Fixed by #352.

ardalis avatar Jul 08 '24 19:07 ardalis