<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dotnet-11 on Tokenise</title><link>https://tokenise.rosvetic.com/tags/dotnet-11/</link><description>Recent content in Dotnet-11 on Tokenise</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Thu, 12 Nov 2026 16:03:00 +0000</lastBuildDate><atom:link href="https://tokenise.rosvetic.com/tags/dotnet-11/index.xml" rel="self" type="application/rss+xml"/><item><title>Your agent's new C# union deserialises half a payload as a valid case: pin it with a JSON corpus</title><link>https://tokenise.rosvetic.com/posts/csharp-15-union-json-ambiguous-cases-agent-dtos/</link><pubDate>Thu, 12 Nov 2026 16:03:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/csharp-15-union-json-ambiguous-cases-agent-dtos/</guid><description>&lt;p&gt;An agent adds a &lt;code&gt;union PaymentMethod(Card, BankTransfer)&lt;/code&gt; to your API, wires it into a minimal API endpoint, and the happy-path tests pass. A client then posts &lt;code&gt;{&amp;quot;brand&amp;quot;:&amp;quot;visa&amp;quot;}&lt;/code&gt;, a card with no number, and the endpoint hands your handler a &lt;code&gt;Card&lt;/code&gt; whose &lt;code&gt;Last4&lt;/code&gt; is null. Nothing threw, and nothing logged. The union did what it was told.&lt;/p&gt;</description></item><item><title>C# 15 ships union types, and the compiler only warns when an agent forgets a case</title><link>https://tokenise.rosvetic.com/posts/csharp-15-union-types-agent-switch-warning/</link><pubDate>Thu, 12 Nov 2026 11:04:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/csharp-15-union-types-agent-switch-warning/</guid><description>&lt;p&gt;C# 15 shipped on 10 November 2026 with .NET 11, and its headline feature fixes a problem that every agent-written pull request in a C# codebase has: a new case gets added in one place and silently ignored in the rest. A &lt;code&gt;union&lt;/code&gt; declares a closed set of case types, and a &lt;code&gt;switch&lt;/code&gt; over it is checked for exhaustiveness without a catch-all arm. Microsoft&amp;rsquo;s &lt;a href="https://devblogs.microsoft.com/dotnet/announcing-dotnet-11/" target="_blank" rel="noopener noreferrer"&gt;announcement&lt;/a&gt;&#10; says C# 15 is the default language version for &lt;code&gt;net11.0&lt;/code&gt;, and the &lt;a href="https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-15" target="_blank" rel="noopener noreferrer"&gt;C# 15 page&lt;/a&gt;&#10; says that apart from the memory safety work, none of it needs &lt;code&gt;LangVersion&lt;/code&gt; set to &lt;code&gt;preview&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>