Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support targeting multiple frameworks with conditions. #182

Open
dulsi opened this issue Mar 22, 2024 · 1 comment
Open

Does not support targeting multiple frameworks with conditions. #182

dulsi opened this issue Mar 22, 2024 · 1 comment
Labels
bug Something isn't working large More than a day's effort

Comments

@dulsi
Copy link

dulsi commented Mar 22, 2024

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

@SteveDesmond-ca
Copy link
Member

SteveDesmond-ca commented Apr 1, 2024

👍 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working large More than a day's effort
Projects
None yet
Development

No branches or pull requests

2 participants