You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐞 Issue: Incorrect Vulnerability Warning and Upgrade Suggestion for System.Text.Json in Visual Studio
Summary
Visual Studio incorrectly displays a vulnerability warning and suggests updating System.Text.Json to version 8.0.5, even though this version is already being resolved and used at runtime.
Affected Environment
Visual Studio 2022+
SDK-style .NET project
Target frameworks: net6.0;net8.0
Transitive dependency: System.Text.Json
Observed Behavior
Visual Studio shows System.Text.Json (8.0.5) as vulnerable.
It suggests an update to the same version, which is misleading.
Build artifacts show:
net6.0 resolves version 8.0.5 (from NuGet, transitively)
net8.0 resolves version 6.0.0 (from shared framework)
Expected Behavior
Visual Studio should detect that System.Text.Json version 8.0.5 is already resolved and used.
No update prompt should appear for the same version.
Vulnerability status should match runtime resolution.
Steps to Reproduce
Create a .NET project targeting both net6.0 and net8.0.
Include a dependency (e.g., Microsoft.Extensions.Configuration.Json) that pulls in System.Text.Json transitively.
Open the project in Visual Studio.
Observe vulnerability warning and update suggestion.
🐞 Issue: Incorrect Vulnerability Warning and Upgrade Suggestion for
System.Text.Json
in Visual StudioSummary
Visual Studio incorrectly displays a vulnerability warning and suggests updating
System.Text.Json
to version8.0.5
, even though this version is already being resolved and used at runtime.Affected Environment
net6.0;net8.0
System.Text.Json
Observed Behavior
System.Text.Json (8.0.5)
as vulnerable.net6.0
resolves version8.0.5
(from NuGet, transitively)net8.0
resolves version6.0.0
(from shared framework)Expected Behavior
System.Text.Json
version8.0.5
is already resolved and used.Steps to Reproduce
net6.0
andnet8.0
.Microsoft.Extensions.Configuration.Json
) that pulls inSystem.Text.Json
transitively.Workaround
Explicitly add the dependency in
.csproj
:This suppresses the warning and aligns Visual Studio with the actual runtime resolution.
Impact
Suggested Fix
Update Visual Studio’s NuGet analysis to cross-reference runtime resolution (e.g.,
deps.json
,project.assets.json
) before issuing upgrade/vulnerability warnings.The text was updated successfully, but these errors were encountered: