Skip to content

Commit

Permalink
[build]: fixed last .NET 8.0 issue?
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflill committed Dec 9, 2023
1 parent a8b61c1 commit 6ef8013
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,22 @@
</PropertyGroup>

<!--
For some reason, .NET 8.0 SDK release packages are referencing these but
older versions are present at runtime, resulting in [FileBotFoundException].
Projects targeting .NET 7.0 and earlier need these packages.
We're going to inject the .NET 8.0 versions of these packages into
all projects.
-->
WARNING: Do not reference this when targeting .NET 8.0+ unless you
want to debug strange "GenerateDepsFile" build problems.
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>
We'll need to add another ItemGroup/condition when we
upgrade to .NET 9.0 and beyond in the future.
-->

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>
<Target Name="CheckBclPackageRefs" BeforeTargets="Compile" Condition="'$(TargetFramework)' == 'net9.0'">
<Error Text="Add a new [Microsoft.Bcl.AsyncInterfaces] package reference exclusion for .net9.0 and update this target condition to net10.0." />
</Target>

<!--
We have a somewhat complex build environment. The NEONCLOUD repo is private and
Expand Down

0 comments on commit 6ef8013

Please sign in to comment.