dotnet-libyear
dotnet-libyear copied to clipboard
Does not support targeting multiple frameworks with conditions.
Steps to reproduce
- Create a project.
- Add a package.
- Modify the project to support multiple frameworks
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
- Modify the project so that it uses different packages depending on target framework.
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
</ItemGroup>
Expected behavior I think the best default would be to just check the latest framework. Probably add a command line argument to specify the framework.
Observed behavior ArgumentException: An item with the same key has already been added. Key: Microsoft.Net.Http.Headers
:+1: same as #181: at the very least, it shouldn't crash!
I think, given the complexity, initially the app should just respond stating that multiple target frameworks aren't supported.