<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>2025-11 on Funky Si's Test</title><link>https://blog-test.funkysi1701.com/2025/11/</link><description>Recent content in 2025-11 on Funky Si's Test</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>funkysi1701@gmail.com (Simon Foster)</managingEditor><webMaster>funkysi1701@gmail.com (Simon Foster)</webMaster><lastBuildDate>Mon, 17 Nov 2025 20:00:00 +0000</lastBuildDate><atom:link href="https://blog-test.funkysi1701.com/2025/11/index.xml" rel="self" type="application/rss+xml"/><item><title>Blazor and .NET 10 breaking changes</title><link>https://blog-test.funkysi1701.com/posts/2025/blazor-and-dotnet10/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Mon, 17 Nov 2025 20:00:00 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2025/blazor-and-dotnet10/</guid><category term="Blazor">Blazor</category><category term=".NET10">.NET10</category><category term="WebAssembly">WebAssembly</category><category term="Wasm">Wasm</category><category term="HttpClient">HttpClient</category><category term="breakingchange">breakingchange</category><category term="DotNet">DotNet</category><category term="VisualStudio">VisualStudio</category><category term="release">release</category><category term="streamingresponse">streamingresponse</category><category term="C-Sharp">C-Sharp</category><media:content medium="image" type="image/png" url="https://blog-test.funkysi1701.com/images/2025/Android%20Small.png"/><description>&lt;h2 id="whats-new-in-net-10"&gt;What’s New in .NET 10?&lt;a class="anchor ms-1" href="#whats-new-in-net-10" aria-label="Permalink: What’s New in .NET 10?"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;.NET 10 was released this week and it is full of awesome new features. Check it out at &lt;a href="https://dotnet.microsoft.com/download/dotnet/10.0" target="_blank" rel="noopener noreferrer"&gt;.NET Download&lt;/a&gt;
, there is also a new version of &lt;a href="https://visualstudio.microsoft.com/" target="_blank" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt;
which you should also check out.&lt;/p&gt;
&lt;p&gt;I quickly upgraded my .NET projects to take advantage of the new version, but my Blazor WebAssembly (Wasm) project encountered the following error in the browser console:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;System.NotSupportedException: net_http_synchronous_reads_not_supported
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at System.Net.Http.BrowserHttpReadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at System.IO.DelegatingStream.Read(Byte[] buffer, Int32 offset, Int32 count)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at System.IO.StreamReader.ReadBuffer(Span`1 userBuffer, Boolean&amp;amp; readToUserBuffer)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at System.IO.StreamReader.ReadSpan(Span`1 buffer)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonTextReader.ReadData(Boolean append, Int32 charsRequired)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonTextReader.ReadData(Boolean append)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonTextReader.ParseValue()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonTextReader.Read()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonReader.ReadAndMoveToContent()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at Newtonsoft.Json.JsonSerializer.Deserialize[MyResult](JsonReader reader)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at MyAPI.Client.MyClient.&amp;lt;ReadObjectResponseAsync&amp;gt;d__57`1[[MyAPI.Client.MyResult, MyAPI.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; at MyAPI.Client.MyClient.MyAsync(MyRequest body, CancellationToken cancellationToken)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This error was getting thrown on a Blazor Wasm page when it tried to make a call to my API. This worked fine in .NET 9 so my suspicion was this might be a breaking change.&lt;/p&gt;
&lt;p&gt;The list of new features for .NET 10 can be found &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-10.0?view=aspnetcore-9.0" target="_blank" rel="noopener noreferrer"&gt;.NET 10 Release Notes&lt;/a&gt;
&lt;/p&gt;
&lt;h2 id="httpclient-response-streaming-breaking-change-in-blazor"&gt;HttpClient Response Streaming: Breaking Change in Blazor&lt;a class="anchor ms-1" href="#httpclient-response-streaming-breaking-change-in-blazor" aria-label="Permalink: HttpClient Response Streaming: Breaking Change in Blazor"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I found the following new feature which I suspect is related to my issue:&lt;/p&gt;
&lt;p&gt;HttpClient response streaming enabled by default&lt;/p&gt;
&lt;p&gt;In prior Blazor releases, response streaming for HttpClient requests was opt-in. Now, response streaming is enabled by default.&lt;/p&gt;
&lt;p&gt;This is a breaking change because calling &lt;code&gt;HttpContent.ReadAsStreamAsync&lt;/code&gt; for an &lt;code&gt;HttpResponseMessage.Content&lt;/code&gt; (&lt;code&gt;response.Content.ReadAsStreamAsync()&lt;/code&gt;) returns a &lt;code&gt;BrowserHttpReadStream&lt;/code&gt; and no longer a &lt;code&gt;MemoryStream&lt;/code&gt;. &lt;code&gt;BrowserHttpReadStream&lt;/code&gt; doesn&amp;rsquo;t support synchronous operations, such as &lt;code&gt;Stream.Read(Span&amp;lt;Byte&amp;gt;)&lt;/code&gt;. If your code uses synchronous operations, you can opt-out of response streaming or copy the &lt;code&gt;Stream&lt;/code&gt; into a &lt;code&gt;MemoryStream&lt;/code&gt; yourself.&lt;/p&gt;
&lt;p&gt;To opt-out of response streaming globally, use either of the following approaches:&lt;/p&gt;
&lt;p&gt;Add the &amp;lt;WasmEnableStreamingResponse&amp;gt; property to the project file with a value of false:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;WasmEnableStreamingResponse&amp;gt;&lt;/span&gt;false&lt;span style="color:#f92672"&gt;&amp;lt;/WasmEnableStreamingResponse&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Set the DOTNET_WASM_ENABLE_STREAMING_RESPONSE environment variable to false or 0.&lt;/p&gt;
&lt;p&gt;To opt-out of response streaming for an individual request, set &lt;code&gt;SetBrowserResponseStreamingEnabled&lt;/code&gt; to false on the &lt;code&gt;HttpRequestMessage&lt;/code&gt; (&lt;code&gt;requestMessage&lt;/code&gt; in the following example):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;requestMessage.SetBrowserResponseStreamingEnabled(&lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For more information, see HttpClient and HttpRequestMessage with Fetch API request options (Call web API article).&lt;/p&gt;
&lt;h2 id="how-to-fix-the-streaming-issue-in-blazor"&gt;How to Fix the Streaming Issue in Blazor&lt;a class="anchor ms-1" href="#how-to-fix-the-streaming-issue-in-blazor" aria-label="Permalink: How to Fix the Streaming Issue in Blazor"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To test out if this was the culprit I added &lt;code&gt;&amp;lt;WasmEnableStreamingResponse&amp;gt;false&amp;lt;/WasmEnableStreamingResponse&amp;gt;&lt;/code&gt; to my csproj file and sure enough this fixed my issue.&lt;/p&gt;
&lt;p&gt;Do check out the docs for a complete list of new features and any other potential breaking changes. &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-10.0?view=aspnetcore-10.0" target="_blank" rel="noopener noreferrer"&gt;.NET 10 Release Notes&lt;/a&gt;
&lt;/p&gt;</description></item></channel></rss>