惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
博客园_首页
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
美团技术团队
D
Docker
WordPress大学
WordPress大学
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
Y
Y Combinator Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

.NET Blog

Use C# unions and closed hierarchies in ASP.NET Core - .NET Blog Announcing .NET 11 Release Candidate 1 - .NET Blog .NET Conf 2026 Community Days Call for Presenters Is Open - .NET Blog .NET and .NET Framework September 2026 servicing releases updates - .NET Blog Test what you ship: MSTest and Native AOT - .NET Blog How Uno Platform uses .NET, MCP, and AI to build high quality apps - .NET Blog .NET Conf 2026 - .NET Blog From dotnet run to Foundry Hosted Agent in 3 lines of C# - .NET Blog Explore new features available in C# 15 preview - .NET Blog Routing and Failover for Microsoft.Extensions.AI - .NET Blog Instructions Hygiene - What Frontier Models Still Need You to Say - .NET Blog .NET 11 Preview 7 is now available! - .NET Blog .NET and .NET Framework August 2026 servicing releases updates - .NET Blog Test reporting in Microsoft.Testing.Platform: from red build to root cause - .NET Blog Beyond Chat: live Speech-to-Text with Foundry Local and C# - .NET Blog Strengthening NuGet Supply Chain Security: Reducing API Key Lifetime - .NET Blog From generated code to trusted code with a unit-test agent - .NET Blog Announcing v2.0 of the official MCP C# SDK - .NET Blog Analyze MSBuild Binary Logs with Copilot in VS Code - .NET Blog Announcing .NET Modernization for Beginners - .NET Blog .NET and .NET Framework July 2026 servicing releases updates - .NET Blog CoreCLR Progress and the Mono Timeline for .NET MAUI - .NET Blog .NET 11 Preview 6 is now available! - .NET Blog Modernize .NET applications in the GitHub Copilot app - .NET Blog MCP Beyond the Chat Window: Build Diagnostics in CI - .NET Blog .NET 8 and .NET 9 will reach End of Support on November 10, 2026 - .NET Blog SkiaSharp 4.0 is here: announcing the first stable release - .NET Blog Packaging and Package Identity for .NET apps with WinApp CLI on Windows - .NET Blog AI-Powered MSBuild Investigation with the Microsoft Binlog MCP Server - .NET Blog Join us for .NET Day on Agentic Modernization Livestream
VSTest is Removing its Newtonsoft.Json Dependency
McKenna Barl · 2026-04-30 · via .NET Blog

Starting in .NET 11 Preview 4 and Visual Studio 18.8, VSTest, the platform that powers dotnet test and Test Explorer, will no longer depend on Newtonsoft.Json. The platform will now use System.Text.Json on .NET and JSONite on .NET Framework.

This is a servicing and security change. Most projects require no action. A small number of projects will see an obvious build or test failure and can resolve it with a one line PackageReference.

Why this change?

VSTest has shipped Newtonsoft.Json as part of the .NET SDK and Visual Studio for years. All versions of Newtonsoft.Json below 13.0.0 are now marked vulnerable on NuGet.org, and carrying the dependency exposes the test platform to future advisories in a component it no longer needs. Removing it is part of the broader effort to remove Newtonsoft.Json from the .NET SDK.

What is not changing?

  • The VSTest wire format is unchanged. Messages serialize identically whether Newtonsoft.Json, System.Text.Json, or JSONite is used.
  • Older testhosts remain compatible with the updated platform, and vice versa.
  • Serialization performance is the same or better.

Who is not affected?

Most test projects fall into this bucket:

  • Projects that do not use Newtonsoft.Json.
  • Projects that reference Newtonsoft.Json as a normal PackageReference.
  • xUnit and NUnit projects running on .NET, or using AppDomains. These already required an explicit reference.

Who is affected, and how to fix it

Every failure below is non-silent, is reported in the test run, and flows into TRX and the Azure DevOps / GitHub test views.

Build error: missing Newtonsoft.Json reference

If a test project uses Newtonsoft.Json types (for example JObject, JsonConvert) without referencing the package, it previously compiled only because Newtonsoft.Json leaked through VSTest. After the update it will not.

Fix: add the package.

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

Runtime error: FileNotFoundException for Newtonsoft.Json

Projects that reference Newtonsoft.Json but exclude the runtime asset — for example:

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

relied on VSTest’s copy being present at test time. After the update the test run will fail with:

System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.

Fix: remove <ExcludeAssets>runtime</ExcludeAssets>, or install Newtonsoft.Json without excluding runtime assets.

Extension load error in a test adapter or data collector

Adapters and data collectors that used Newtonsoft.Json without declaring it as a dependency will fail at load time with a message such as:

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, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.

The message names the exact extension that needs to be updated, however we are not aware of any shipping adapter or collector that hits this today. Extension authors should add Newtonsoft.Json (or migrate off it) in their own package; consumers can add Newtonsoft.Json to the test project, or disable the affected extension until it is updated.

Public API change

VSTest exposed Newtonsoft.Json.Linq.JToken in one spot of its communication API. That type is being removed from the public surface. It was only meaningful to code participating in the VSTest protocol and is unlikely to have real world consumers, but extension authors should be aware.

When you will see this

Release Date
.NET 11 preview 4 May 12th, 2026
Visual Studio 18.8 Insiders 1 June 9, 2026

Try it early

Preview packages are available on NuGet as Microsoft.TestPlatform.* version 1.0.0-alpha-stj. Details and discussion: microsoft/vstest#15677. Source PR: microsoft/vstest#15540. SDK breaking change tracking: dotnet/docs#53174.

If your build or test run fails after updating with an error mentioning Newtonsoft.Json, the fix is almost always a single PackageReference. For anything not covered above, please open an issue on microsoft/vstest.

Author

McKenna Barlow

Product Manager 2

PM on the .NET Tools Team