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

Warning/errors/messages are not correctly grouped for multi-targeting projects #32055

Open
davkean opened this issue Dec 29, 2018 · 6 comments
Open
Labels
Area-IDE Bug Need Design Review The end user experience design needs to be reviewed and approved.
Milestone

Comments

@davkean
Copy link
Member

davkean commented Dec 29, 2018

Version Used:
Version 16.0.0 Preview 2.0 [28420.135.d16.0stg]

Steps to Reproduce:

  1. Create a new Console App (.NET Core)
  2. Change project to:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp3.0;net45;net46</TargetFrameworks>
  </PropertyGroup>

</Project>
  1. Reload project
  2. Wait for background analysis to be finished

Expected Behavior:
Single message with:

Severity	Code	Description	Project	File	Line	Category	Suppression State
Message	IDE0060	Remove unused parameter 'args'	ConsoleApp338(net45), ConsoleApp338(net46), ConsoleApp(netcoreapp3.0)	C:\Users\davkean\Source\Repos\ConsoleApp338\ConsoleApp338\Program.cs	7	Style	Active

Actual Behavior:
Two messages:

Severity	Code	Description	Project	File	Line	Category	Suppression State
Message	IDE0060	Remove unused parameter 'args'	ConsoleApp338(net45), ConsoleApp338(net46)	C:\Users\davkean\Source\Repos\ConsoleApp338\ConsoleApp338\Program.cs	7	Style	Active
Message	IDE0060	Remove unused parameter 'args'	ConsoleApp338(netcoreapp3.0)	C:\Users\davkean\Source\Repos\ConsoleApp338\ConsoleApp338\Program.cs	7	Style	Active

tag @mavasani @heejaechang

@sharwell sharwell added Bug Area-Analyzers Need Design Review The end user experience design needs to be reviewed and approved. labels Jan 2, 2019
@sharwell sharwell added this to In Queue in IDE: Design review via automation Jan 2, 2019
@vatsalyaagrawal vatsalyaagrawal added this to the 16.0 milestone Jan 3, 2019
@mavasani
Copy link
Member

So after playing around with this further, it seems something is really broken with multi-targeting projects, but only during the time when user is editing the csproj.

The above given repro steps causes the multiple diagnostics issue to show up sometimes, but not always. Additionally, editing the csproj to remove and then re-add any of the target frameworks causes the diagnostic for that framework to go away from the error list and never re-appear. See the below gif:

multitfm

If I re-add the new target frameworks one at a time, I see an additional duplicate diagnostic show up for every added target framework, see the below gif:

multitfm_2

For all the above cases, unloading and reloading the project OR closing and reopening the solution always fixes the issue and we end up a single correct de-duplicated diagnostic which lists all the target frameworks.

@mavasani
Copy link
Member

Also confirmed that the issue is not specific to any analyzer, it repros even with compiler diagnostics.

@mavasani mavasani changed the title Analyzers warning/errors/messages are not correctly grouped for multi-targeting projects Warning/errors/messages are not correctly grouped for multi-targeting projects Jan 14, 2019
@mavasani mavasani removed their assignment Jan 14, 2019
@mavasani
Copy link
Member

@sharwell - any reason this has been marked as Needs design review?

@davkean
Copy link
Member Author

davkean commented Jan 16, 2019

Also confirmed that the issue is not specific to any analyzer, it repros even with compiler diagnostics.

What is the repro for this? Make sure this isn't build-time because that would likely be: dotnet/project-system#2811.

@mavasani
Copy link
Member

What is the repro for this?

Just have a simple method with an unused local, which generates a CS diagnostic.

@mavasani
Copy link
Member

Make sure this isn't build-time

Yep, I never did a build.

@jinujoseph jinujoseph modified the milestones: 16.0, 16.1 Jan 16, 2019
@jinujoseph jinujoseph modified the milestones: 16.1, Backlog Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Need Design Review The end user experience design needs to be reviewed and approved.
Projects
Status: In Queue
IDE: Design review
  
In Queue
Development

No branches or pull requests

5 participants