Skip to content

Commit 0c7431f

Browse files
kzujonsequitur
authored andcommitted
Avoid build failures when .NET 462 targeting pack is missing
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
1 parent 3a9d4dd commit 0c7431f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="FluentAssertions" Version="5.10.3" />
18+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
1819
</ItemGroup>
1920

2021
<ItemGroup Condition="'$(TargetFramework)'!='net5.0'">

src/System.CommandLine.Tests/System.CommandLine.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<ItemGroup>
2222
<PackageReference Include="ApprovalTests" Version="5.2.2" />
2323
<PackageReference Include="FluentAssertions" Version="5.10.3" />
24+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
2425
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
2526
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
2627
</ItemGroup>

0 commit comments

Comments
 (0)