Skip to content

Commit

Permalink
Avoid build failures when .NET 462 targeting pack is missing
Browse files Browse the repository at this point in the history
These two test projects multitarget net462 on Windows, but if the
targeting pack is missing, the build will fail. This can be avoided
by installing the reference assemblies package, which will automatically
provide the right dependencies according to the TFM.

Rather than depending on Microsoft.NETFramework.ReferenceAssemblies.net462,
this adds the metapackage, which will automatically pick the right dependency
if the projects are ever updated (i.e. to net472, which sounds like it would
be a good idea.

Fixes #1252
  • Loading branch information
kzu authored and jonsequitur committed Apr 14, 2021
1 parent 3a9d4dd commit 0c7431f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net5.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ItemGroup>
<PackageReference Include="ApprovalTests" Version="5.2.2" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
</ItemGroup>
Expand Down

0 comments on commit 0c7431f

Please sign in to comment.