{"id":3957,"date":"2026-04-29T20:23:58","date_gmt":"2026-04-29T20:23:58","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/04\/29\/vstest-is-removing-its-newtonsoft-json-dependency\/"},"modified":"2026-04-29T20:23:58","modified_gmt":"2026-04-29T20:23:58","slug":"vstest-is-removing-its-newtonsoft-json-dependency","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/04\/29\/vstest-is-removing-its-newtonsoft-json-dependency\/","title":{"rendered":"VSTest is Removing its Newtonsoft.Json Dependency"},"content":{"rendered":"<p>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.  <\/p>\n<p>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.  <\/p>\n<h2>Why this change?<\/h2>\n<p>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 <a href=\"https:\/\/github.com\/dotnet\/sdk\/issues\/53287\">broader effort to remove Newtonsoft.Json from the .NET SDK.<\/a><\/p>\n<h2>What is not changing?<\/h2>\n<ul>\n<li>The VSTest wire format is unchanged. Messages serialize identically whether Newtonsoft.Json, System.Text.Json, or JSONite is used.<\/li>\n<li>Older testhosts remain compatible with the updated platform, and vice versa.<\/li>\n<li>Serialization performance is the same or better.<\/li>\n<\/ul>\n<h2>Who is not affected?<\/h2>\n<p>Most test projects fall into this bucket:<\/p>\n<ul>\n<li>Projects that do not use Newtonsoft.Json.<\/li>\n<li>Projects that reference Newtonsoft.Json as a normal PackageReference.<\/li>\n<li>xUnit and NUnit projects running on .NET, or using AppDomains. These already required an explicit reference.<\/li>\n<\/ul>\n<h2>Who is affected, and how to fix it<\/h2>\n<p>Every failure below is non-silent, is reported in the test run, and flows into TRX and the Azure DevOps \/ GitHub test views.<\/p>\n<h3>Build error: missing Newtonsoft.Json reference<\/h3>\n<p>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.<\/p>\n<p><strong>Fix:<\/strong> add the package.<\/p>\n<pre><code class=\"language-text\">&lt;PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\" \/&gt;<\/code><\/pre>\n<h3>Runtime error: FileNotFoundException for Newtonsoft.Json<\/h3>\n<p>Projects that reference Newtonsoft.Json but exclude the runtime asset \u2014 for example:<\/p>\n<pre><code class=\"language-xml\">&lt;PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.3\"&gt;\n  &lt;ExcludeAssets&gt;runtime&lt;\/ExcludeAssets&gt;\n&lt;\/PackageReference&gt;<\/code><\/pre>\n<p>relied on VSTest\u2019s copy being present at test time. After the update the test run will fail with:<\/p>\n<pre><code class=\"language-text\">System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.<\/code><\/pre>\n<p><strong>Fix:<\/strong> remove <code>&lt;ExcludeAssets&gt;runtime&lt;\/ExcludeAssets&gt;<\/code>, or install Newtonsoft.Json without excluding runtime assets.<\/p>\n<h3>Extension load error in a test adapter or data collector<\/h3>\n<p>Adapters and data collectors that used Newtonsoft.Json without declaring it as a dependency will fail at load time with a message such as:<\/p>\n<pre><code class=\"language-text\">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'.<\/code><\/pre>\n<p>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.<\/p>\n<h3>Public API change<\/h3>\n<p>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.  <\/p>\n<h3>When you will see this<\/h3>\n<table>\n<thead>\n<tr>\n<th><strong>Release<\/strong><\/th>\n<th><strong>Date<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>.NET 11 preview 4<\/td>\n<td>May 12th, 2026<\/td>\n<\/tr>\n<tr>\n<td>Visual Studio 18.8 Insiders 1<\/td>\n<td>June 9, 2026<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Try it early<\/h3>\n<p>Preview packages are available on NuGet as <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.TestPlatform\/1.0.0-alpha-stj-26213-07\">Microsoft.TestPlatform.* version 1.0.0-alpha-stj<\/a>. Details and discussion: <a href=\"https:\/\/github.com\/microsoft\/vstest\/issues\/15677\">microsoft\/vstest#15677<\/a>. Source PR: <a href=\"https:\/\/github.com\/microsoft\/vstest\/pull\/15540\">microsoft\/vstest#15540<\/a>. SDK breaking change tracking: <a href=\"https:\/\/github.com\/dotnet\/docs\/issues\/53174\">dotnet\/docs#53174<\/a>.<\/p>\n<p>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 <a href=\"https:\/\/github.com\/microsoft\/vstest\/issues\">microsoft\/vstest<\/a>.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/vs-test-is-removing-its-newtonsoft-json-dependency\/\">VSTest is Removing its Newtonsoft.Json Dependency<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Starting in .NET 11 Preview 4 and Visual Studio 18.8, VSTest, the platform that powers dotnet test and Test Explorer, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":94,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3957","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/3957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=3957"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/3957\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media\/94"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=3957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=3957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=3957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}