7 Critical Updates: VSTest Drops Newtonsoft.Json Dependency – What You Need to Know

Starting with .NET 11 Preview 4 and Visual Studio 18.8, the VSTest platform—which powers dotnet test and Test Explorer—is officially removing its dependency on Newtonsoft.Json. This shift is a servicing and security measure, replacing Newtonsoft.Json with System.Text.Json on .NET and JSONite on .NET Framework. While most projects will sail through without any changes, a handful may encounter clear build or test failures. These issues are easily resolved with a single line PackageReference. Below, we break down everything you need to know in a numbered list, from the reasons behind the change to step-by-step fixes for affected scenarios.

1. What Exactly Is Changing in VSTest?

VSTest has bundled Newtonsoft.Json for years as part of the .NET SDK and Visual Studio. Beginning with .NET 11 Preview 4 and Visual Studio 18.8, that bundled reference is gone. The platform now uses System.Text.Json (on .NET) and JSONite (on .NET Framework) for its internal serialization needs. This means VSTest no longer relies on Newtonsoft.Json at all. The change is purely internal—your test projects won't see any difference unless they previously depended on Newtonsoft.Json leaking through VSTest.

7 Critical Updates: VSTest Drops Newtonsoft.Json Dependency – What You Need to Know
Source: devblogs.microsoft.com

2. Why the Sudden Drop? Security and Maintenance

All versions of Newtonsoft.Json below 13.0.0 are now flagged as vulnerable on NuGet.org. By carrying this dependency, VSTest exposed itself to future security advisories for a component it doesn't actually need. Removing Newtonsoft.Json is part of a broader initiative to phase it out entirely from the .NET SDK. The move simplifies the platform's supply chain and reduces the attack surface. For you, it means fewer transitive vulnerabilities to worry about when running tests.

3. What Stays the Same? Wire Format, Compatibility, and Performance

Don't worry—your existing test infrastructure remains compatible. The VSTest wire format hasn't changed. Whether Newtonsoft.Json, System.Text.Json, or JSONite is used, messages serialize identically, so older test hosts continue to work with the updated platform and vice versa. Serialization performance is either the same or better, thanks to the modern libraries employed. You won't need to update your test runners or CI/CD pipelines just for this change.

4. Who Won’t Be Affected? The Vast Majority

Most test projects fall into the unaffected bucket. This includes:

If your project fits any of these categories, you can safely ignore the rest of this list. No action needed.

5. Affected: Build Error “Missing Newtonsoft.Json Reference”

If your test project uses Newtonsoft.Json types (like JObject or JsonConvert) without having the NuGet package referenced, you previously got away with it because Newtonsoft.Json leaked through VSTest. After the update, the compiler will throw a clear error: missing reference. The fix is straightforward: add the package explicitly.

7 Critical Updates: VSTest Drops Newtonsoft.Json Dependency – What You Need to Know
Source: devblogs.microsoft.com
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

That one line resolves the build failure. No other changes needed.

6. Affected: Runtime FileNotFoundException with ExcludeAssets

Projects that reference Newtonsoft.Json but ExcludeAssets the runtime asset—like this:

<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
  <ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>

—relied on VSTest's copy being available at test time. With VSTest no longer shipping Newtonsoft.Json, you'll see a System.IO.FileNotFoundException for version 13.0.0.0. The fix: either remove the <ExcludeAssets>runtime</ExcludeAssets> element, or install Newtonsoft.Json without excluding runtime assets. Doing so ensures the assembly is present when your tests run.

7. Affected: Extension Load Error in Adapters or Data Collectors

Test adapters and data collectors that used Newtonsoft.Json without declaring it as a dependency will fail at load time. The error message will be something like:

Data collector 'SampleDataCollector' threw an exception during type loading, construction, or initialization: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, ...

This happens because the extension itself depends on Newtonsoft.Json but never listed it in its own dependencies. The solution is to ensure the extension project includes a PackageReference for Newtonsoft.Json (version 13.0.3 or compatible). If you're the author of such an extension, update its .csproj accordingly. If you're a consumer, contact the extension maintainer to issue a fix.

Every failure listed above is non-silent—it will be reported in the test run and show up in TRX files and Azure DevOps/GitHub test views. So you won't miss it. In each case, the remedy is simple: ensure Newtonsoft.Json (version 13.0.3 or later) is properly referenced as a direct dependency in your test project or extension. With that one adjustment, your tests will run smoothly under the updated VSTest.

Tags:

Recommended

Discover More

AES-128 in the Quantum Age: Debunking the MythsEverything You Need to Know About Ubuntu 26.04 LTS 'Resolute Raccoon'From Vibe to Code: The Evolving Role of UX Designers in an AI-Driven Market7 Key Insights into Nintendo Direct's 15-Year Legacy — And Why It Might Not LastRust 1.94.0 Released: Array Windows, Smarter Cargo Config, and TOML 1.1