How to stop .NET runtime generate lower version of nuget packages explicitly?

31 Views Asked by At

I am using System.Diagnostics.PerformanceCounter version 7.0.0 in .NET6. While running my application why does it generate version 4.7 along with 7.0 in the nuget cache folder? It is mentioned in Nuget.org that the nuget Microsoft.ApplicationInsights.PerfCounterCollector 2.21.0 has dependency on System.Diagnostics.PerformanceCounter versions >=4.7. So why it brings version 4.7 instead of the highest version 7.0. Clearly 7.0.0 >= 4.7.0 ? This is regarding Mend Vulnerability test where the Mend Software accesses the nuget cache folders and brings this objections about lower versions of nugets with vulnerabilities. Please suggest suitable actions. 

If I add 7.0.0 version of the "System.Diagnostics.PerformanceCounter" explicity in my end-consumer project, the BIN folder contains 7.0.0 dll, however, the nuget cache folder has both 4.7 and 7 which the Mend software flags as a vulnerability with 4.7.

0

There are 0 best solutions below