dotnet-libyear icon indicating copy to clipboard operation
dotnet-libyear copied to clipboard

Does not support targeting multiple frameworks with conditions.

Open dulsi opened this issue 5 months ago • 1 comments

Steps to reproduce

  1. Create a project.
  2. Add a package.
  3. Modify the project to support multiple frameworks <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
  4. 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

dulsi avatar Mar 22 '24 15:03 dulsi

:+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.

SteveDesmond-ca avatar Apr 01 '24 18:04 SteveDesmond-ca