NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

[Suggestion] Error List Window should not show duplicated NuGet warnings or errors when installing package or editing the ‘csproj’ file #13682

Open v-luzh opened 3 months ago

v-luzh commented 3 months ago

NuGet Product Used

Visual Studio Package Management UI

Product Version

Dev\6.12.0.58

Worked before?

It is not a regression since it reproes (just for NU1202 since we don’t have the feature ‘Vulnerable Package’ on 16.11) on D16.11\34601.136.

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:

  1. Create a project through menu ‘File -> New Project -> .NET Standard Class Library’ (with latest .NET Standard version).
  2. Change target framework to Netstandard 1.4.
  3. Close ‘Error List’ window and ‘Output’ windows if open.
  4. Launch PM UI and install Microsoft.AspNetCore.Mvc.ViewFeatures/1.1.3.
  5. Edit the 'csproj' file to add the following:
    <ItemGroup> 
     <PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="1.1.3"/> 
    </ItemGroup> 

    Expected Result:

    No duplicated warnings or errors in step4 and step5.

    Actual Result:

    Duplicated NU1903 show in step4 and duplicated NU1202 show in step5. image

    Note:

  6. Repro rate: 100%.
  7. It would not repro after building the solution.

Verbose Logs

No response

Nigusu-Allehu commented 3 months ago

I did get duplicated NU1202, but not NU1903

jeffkl commented 2 months ago

@donnie-msft need to figure if there are duplicates in the assets file and if not, then move to project system.

nkolev92 commented 1 month ago

This needs double checked by hotseta

v-luzh commented 3 weeks ago

Hi @nkolev92, please discuss this bug in the triage meeting, thanks. Correct the label updated by Robot.

nkolev92 commented 3 weeks ago

Thanks for the ping @v-luzh!

I can repro this:

  1. NU1202 in the assets file appears once, which is why build makes the duplicated warning go away.
  2. The 2nd NU1202 is due to the fact that we manually manage the error list when we do installation (since it's temporary), and then I'm guessing there's just no gesture to clear it. Note that Package restore failed. Rolling back package changes for... is still in the error list as well.

The solution probably needs to be clearing the error list from our warnings/errors when starting up restore.