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

[Microsoft.CodeAnalysis.Metrics] Duplicated target csproj entries in report when input sln includes multi-target framework csproj #7415

Open
mrpetro opened this issue Sep 18, 2024 · 0 comments

Comments

@mrpetro
Copy link

mrpetro commented Sep 18, 2024

NuGet Package: microsoft.codeanalysis.metrics

Version: 4.0.0-beta1.24415.1

Description

Microsoft.CodeAnalysis.Metrics tool will duplicate analysis of same csproj file if csproj has TargetFrameworks with more than one target framework. Resulting CodeMetricsReport xml file will contain duplicated entry of same csproj.

Steps To Reproduce

  1. Open any recent Visual Studio, create solution and add new csproj with Microsoft.NET.Sdk style
  2. Set replace it target framework with multi-target frameworks, i.e.:
    <TargetFrameworks>net48;net8.0</TargetFrameworks>
  3. Use metrics.exe from Metrics folder of microsoft.codeanalysis.metrics package to produce CodeMetricsReport xml file. Example command:
    Metrics.exe /solution:"D:\Projects\msix\Calc\Calc.sln" /out:"D:\Projects\metrics\Metrics\out.xml"

Expected behavior

Resulting CodeMetricsReport xml file should not contain any duplicated target csproj entries or target csproj entries should somehow be distinguished based on target framework.

Actual behavior

Resulting CodeMetricsReport xml file contains duplicated Target csproj entries with exact same analysis values.

Additional context

Issue is not reproducible if problematic csproj is given as input to Metrics.exe using /solution argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant