<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Satish’s Blog]]></title><description><![CDATA[Satish’s Blog]]></description><link>https://read.satishyadav.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 19:05:07 GMT</lastBuildDate><atom:link href="https://read.satishyadav.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What's New in .NET Aspire 9.0]]></title><description><![CDATA[← Previous: What’s New in the SDK and Tooling for .NET 9
.NET Aspire is a set of tools, templates, and packages designed to help developers build observable, production-ready apps that embrace cloud-native and distributed computing best practices. .N...]]></description><link>https://read.satishyadav.com/10-whats-new-in-dotnet-aspire-9-0</link><guid isPermaLink="true">https://read.satishyadav.com/10-whats-new-in-dotnet-aspire-9-0</guid><category><![CDATA[.NET]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[Aspire ]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:22:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/d2ayYjxBa4Q/upload/b7b66670874fe5c06f2d1fe5949319c2.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/9-whats-new-in-the-sdk-and-tooling-for-dotnet-9">← Previous: What’s New in the SDK and Tooling for .NET 9</a></p>
<p><a target="_blank" href="https://github.com/dotnet/aspire">.NET Aspire</a> is a set of tools, templates, and packages designed to help developers build observable, production-ready apps that embrace cloud-native and distributed computing best practices. .NET Aspire 9.0 marks a significant evolution, introducing support for both .NET 8 (LTS) and .NET 9 (STS), along with community-driven improvements, enhanced tooling, and richer dashboards.
</p>
<h2 id="heading-key-highlights">Key Highlights</h2>
<ul>
<li><p><strong>.NET 8 and .NET 9 Compatibility:</strong><br />.NET Aspire 9.0 supports both .NET 8 LTS and .NET 9 STS, giving you the flexibility to adopt whichever runtime best suits your organization's support and innovation needs.</p>
</li>
<li><p><strong>Community-Driven Enhancements:</strong><br />Many of .NET Aspire 9.0’s features are guided by community feedback. Join the conversation on <a target="_blank" href="https://aka.ms/dotnet-discord">Discord</a> or contribute on <a target="_blank" href="https://github.com/dotnet/aspire">GitHub</a> to help shape the future of .NET Aspire.</p>
</li>
</ul>
<h2 id="heading-upgrading-and-tooling">Upgrading and Tooling</h2>
<p><strong>Easier Upgrades to Aspire 9.0:</strong><br />Upgrading to .NET Aspire 9.0 from previous versions is now simpler. The <a target="_blank" href="https://learn.microsoft.com/dotnet/aspire/upgrade">official upgrade guide</a> provides detailed steps, whether you’re upgrading manually or using the Upgrade Assistant.</p>
<p><strong>Simplified Tooling Setup:</strong><br />Previously, .NET Aspire depended on installing workloads. In .NET Aspire 9.0, you can install the new SDK directly into your app host project, streamlining environment configuration and setup.</p>
<p><strong>Templates from NuGet Packages:</strong><br />Templates for creating new .NET Aspire projects have moved to separate NuGet packages. Installing templates now uses <code>dotnet new install Aspire.ProjectTemplates::9.0.0</code>, giving you more control over versioning and updates. If you still have the old Aspire workload installed, add <code>--force</code> to overwrite existing templates.</p>
<h2 id="heading-dashboard-and-ux-enhancements">Dashboard and UX Enhancements</h2>
<p><strong>Resource Lifecycle Management:</strong><br />You can now start, stop, and restart individual resources directly from the .NET Aspire dashboard. This granular control helps you debug and manage complex applications without restarting everything. When debugging is attached, it reattaches on restart.</p>
<p><strong>Mobile-Responsive Dashboard:</strong><br />The Aspire dashboard adapts to various screen sizes, improving accessibility and usability on mobile devices.</p>
<p><strong>Sensitive Property Masking and Enhanced Logs:</strong><br />Mark properties as sensitive to automatically mask them in the dashboard, preventing accidental exposure of secrets. Colorful console logs now properly render combined ANSI escape codes, providing richer and more informative logs.</p>
<h2 id="heading-telemetry-and-observability">Telemetry and Observability</h2>
<p><strong>Improved Telemetry Filtering and Browser Support:</strong><br />Telemetry filtering now supports attribute-based filters with autocompletion, making it easier to focus on relevant traces. You can also combine telemetry from multiple resource replicas and even send telemetry directly from browser-based SPAs into the Aspire dashboard, providing unified observability across clients and servers.</p>
<h2 id="heading-app-host-and-orchestration">App Host and Orchestration</h2>
<p><strong>Waiting for Dependencies and Health Checks:</strong><br />Resources can now wait for dependencies to become ready before starting, leveraging standard .NET health checks. Add HTTP health checks or custom logic to ensure reliable startup sequences. Health check details appear directly in the dashboard.</p>
<p><strong>Persistent Containers and Resource Commands:</strong><br />Persistent containers continue running outside the app host lifecycle, ideal for scenarios like databases you don’t want to tear down after testing. Also, define custom commands for resources, enabling additional lifecycle or operational tasks accessible via the dashboard’s UI.</p>
<p><strong>Eventing Model and Container Networking:</strong><br />Hook into global or resource-specific lifecycle events for more customization. All containers now share a default network, simplifying inter-container communication. Converting from Docker Compose becomes more straightforward.</p>
<h2 id="heading-integrations-and-azure-enhancements">Integrations and Azure Enhancements</h2>
<p><strong>Redis Insight and OpenAI Support (Preview):</strong><br />Integrate Redis Insight for better database observability and configure OpenAI clients more flexibly, choosing between Azure OpenAI or official OpenAI REST endpoints seamlessly.</p>
<p><strong>MongoDB Credentials, Improved Azure Resource Naming and Lifecycles:</strong><br />MongoDB integrations now allow specifying credentials. Azure resource customization, previously experimental, is now stable. Adjusting naming policies ensures smoother transitions from .NET Aspire 8 to 9.</p>
<p><strong>Azure Functions (Preview):</strong><br />One of the most requested features, Azure Functions support, is now in preview. Create and run Azure Functions projects in an Aspire host, debug locally, and deploy to Azure Container Apps seamlessly. Initially supporting common triggers like HTTP, queues, blobs, and service bus, it aligns with .NET Aspire’s goal of simplifying distributed and serverless scenarios.</p>
<p><strong>Customization of Azure Container Apps:</strong><br />Customize Azure Container App definitions without editing Bicep by using the provided APIs. Scale containers, adjust replicas, and tailor your ACA environment programmatically.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>.NET Aspire 9.0 takes another step toward a streamlined, production-ready developer experience. With support for the latest .NET runtimes, a richer dashboard, robust health checks, flexible telemetry, and broader integration capabilities, Aspire 9.0 helps you build, operate, and manage complex distributed applications with confidence and clarity. Whether you’re leveraging .NET 8 LTS stability or embracing .NET 9 innovations, Aspire 9.0 has you covered.</p>
<hr />
<p>This completes our comprehensive look at what’s new across .NET 9, from runtime and languages to libraries, tooling, MAUI, EF Core, ASP.NET Core, ML.NET, SDK improvements, and finally .NET Aspire 9.0. Together, these advancements illustrate a rapidly maturing, increasingly powerful ecosystem that empowers developers to ship robust, scalable, and innovative solutions.</p>
<hr />
<p>Are you planning to upgrade to .NET 9 or will stay at .NET 8? What features are most exciting to you? Let me know in the comments.</p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in the SDK and Tooling for .NET 9]]></title><description><![CDATA[← Previous: What’s New in .NET Libraries for .NET 9
The .NET 9 SDK introduces several new capabilities and improvements to streamline development workflows, enhance build and test experiences, improve NuGet security and performance, and provide great...]]></description><link>https://read.satishyadav.com/9-whats-new-in-the-sdk-and-tooling-for-dotnet-9</link><guid isPermaLink="true">https://read.satishyadav.com/9-whats-new-in-the-sdk-and-tooling-for-dotnet-9</guid><category><![CDATA[dotnet]]></category><category><![CDATA[.NET]]></category><category><![CDATA[sdk]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:22:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/PQa5vHHnpm4/upload/4800240c2c04c57a5b5f75d8a30f51e9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/8-whats-new-in-dotnet-libraries-for-dotnet-9">← Previous: What’s New in .NET Libraries for .NET 9</a></p>
<p>The .NET 9 SDK introduces several new capabilities and improvements to streamline development workflows, enhance build and test experiences, improve NuGet security and performance, and provide greater flexibility in managing .NET workloads and containers. These updates make the overall .NET ecosystem more productive, secure, and maintainable.
</p>
<h2 id="heading-unit-testing-improvements">Unit Testing Improvements</h2>
<p><strong>Run Tests in Parallel:</strong><br />With deeper MSBuild integration, <code>dotnet test</code> can now run tests for the same project across different target frameworks in parallel by default. Parallel test execution scales with the number of available processors, boosting test throughput. You can opt out by setting the <code>TestTfmsInParallel</code> property to <code>false</code>.</p>
<p><strong>Enhanced Test Output in Terminal Logger:</strong><br />The MSBuild terminal logger now supports test result reporting, offering richer feedback both during test execution (showing currently running tests) and after (improved formatting of test failures). This integrated experience replaces multiple loggers with a single, unified output.</p>
<h2 id="heading-net-tool-roll-forward">.NET Tool Roll-Forward</h2>
<p>Previously, .NET global or local tools didn’t always run on newer .NET versions unless tool authors opted in. In .NET 9, you can specify <code>--allow-roll-forward</code> when installing or running a tool. This option configures the tool to run on a newer major version of .NET if the exact target version isn’t available, providing greater flexibility and future-proofing for early adopters.</p>
<h2 id="heading-terminal-logger-enhancements">Terminal Logger Enhancements</h2>
<p>The terminal logger, introduced in .NET 8, is now the default for build, test, and related commands in .NET 9. Enhancements include:</p>
<ul>
<li><strong>Enabled by Default:</strong> No need to manually enable it; it provides clickable links, color-coded warnings and errors, and more concise, user-friendly output.</li>
<li><strong>Summaries for Failures and Warnings:</strong> The logger now shows total warnings and errors at the end of a build, making it easier to track regressions and understand build quality trends.</li>
<li><strong>Improved Multi-line Message Rendering:</strong> Long warnings or errors now appear without repeated file/line prefixes, resulting in cleaner and more readable output.</li>
</ul>
<p>You can still disable it with <code>--tl:off</code> or control behavior through environment variables.</p>
<h2 id="heading-nuget-security-audits-and-performance">NuGet Security Audits and Performance</h2>
<p><strong>Auditing Transitive Dependencies by Default:</strong><br />Starting with .NET 9, <code>dotnet restore</code> audits <strong>all</strong> package references (including transitive) for known vulnerabilities. This enhances supply-chain security by default, catching more issues early.</p>
<p><strong>Faster Dependency Resolution:</strong><br />The NuGet dependency resolver in the SDK has been overhauled for better performance and scalability, especially beneficial for large repositories. If you encounter issues with the new resolver, you can revert to the legacy mechanism, but the default experience should yield significant performance gains.</p>
<h2 id="heading-msbuild-script-analyzers-buildchecks">MSBuild Script Analyzers (BuildChecks)</h2>
<p>A new feature called BuildChecks helps identify defects and regressions in your build scripts. By passing <code>/check</code> to commands like <code>dotnet build</code>, you enable checks that can produce diagnostics for known issues. This feature makes build scripts more maintainable and reliable over time.</p>
<h2 id="heading-analyzer-mismatch-mitigation">Analyzer Mismatch Mitigation</h2>
<p>When running mixed SDK and MSBuild versions, Roslyn analyzers can encounter version mismatches. .NET 9 detects torn SDK scenarios and implicitly downloads a support package (<code>Microsoft.Net.Sdk.Compilers.Toolset</code>) to ensure consistent analyzer experiences, preventing related build warnings and errors.</p>
<h2 id="heading-workload-sets">Workload Sets</h2>
<p>Workload sets enable you to pin all installed workloads to a single, stable version until you explicitly update. This approach prevents unintentional updates and ensures consistent workload environments. You can choose your mode (<code>manifests</code> or <code>workload-set</code>) and easily review current mode status and installation history using <code>dotnet workload config</code> and <code>dotnet workload history</code>.</p>
<h2 id="heading-workload-history">Workload History</h2>
<p><code>dotnet workload history</code> provides a timeline of workload installation and modifications for a given SDK installation. This feature helps you understand how workloads have evolved over time, making it easier to revert or audit changes.</p>
<h2 id="heading-container-support">Container Support</h2>
<p><strong>Insecure Registries:</strong><br />The SDK can now publish images to insecure registries. By configuring your Docker or Podman environment and setting <code>DOTNET_CONTAINER_INSECURE_REGISTRIES</code>, you can push images to non-TLS or self-signed registries for development and testing scenarios.</p>
<p><strong>Environment Variable Renaming:</strong><br />Environment variables controlling container publishing now start with the <code>DOTNET_</code> prefix instead of <code>SDK_</code>. Existing names remain supported for now.</p>
<h2 id="heading-code-analysis">Code Analysis</h2>
<p>.NET 9 adds several new code analyzers and fixers to maintain best practices and improve code quality. New rules include guidance on not passing unnecessary length arguments, advising internal over public types in executables, and ensuring proper usage of hashing APIs, HTTP headers, and streams. For example:</p>
<ul>
<li><strong>CA1872:</strong> Prefer <code>Convert.ToHexString</code> over <code>BitConverter.ToString</code> for encoding bytes to hex.</li>
<li><strong>CA2265:</strong> Avoid comparing <code>Span&lt;T&gt;</code> to <code>null</code> or <code>default</code>.</li>
<li><strong>CA2022:</strong> Avoid partial reads with <code>Stream.Read</code> by checking return values.</li>
</ul>
<p>These rules help keep code robust, efficient, and aligned with .NET best practices.</p>
<p>In summary, the SDK and tooling improvements in .NET 9 focus on accelerating feedback loops (faster tests, better terminal output), strengthening security (enhanced NuGet auditing), providing more stable build environments (workload sets, build checks), and granting developers flexibility in container scenarios and runtime configurations. These enhancements streamline daily workflows, reduce complexity, and empower developers to maintain high-quality, secure, and performant .NET applications.</p>
<p><a target="_blank" href="/10-whats-new-in-dotnet-aspire-9-0">Next → What’s New in .NET Aspire 9.0</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in .NET Libraries for .NET 9]]></title><description><![CDATA[← Previous: What’s New in .NET MAUI for .NET 9  
.NET 9 adds a wide range of enhancements and new APIs across the base class libraries. These improvements touch everything from low-level data structures and cryptography to JSON serialization, text pr...]]></description><link>https://read.satishyadav.com/8-whats-new-in-dotnet-libraries-for-dotnet-9</link><guid isPermaLink="true">https://read.satishyadav.com/8-whats-new-in-dotnet-libraries-for-dotnet-9</guid><category><![CDATA[dotnet]]></category><category><![CDATA[.NET]]></category><category><![CDATA[Libraries]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:22:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Oaqk7qqNh_c/upload/ab8bbd843ee50ab1efaa481edd418108.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/7-whats-new-in-dotnet-maui-for-dotnet-9">← Previous: What’s New in .NET MAUI for .NET 9</a>  </p>
<p>.NET 9 adds a wide range of enhancements and new APIs across the base class libraries. These improvements touch everything from low-level data structures and cryptography to JSON serialization, text processing, spans, and advanced math capabilities. The updates enhance performance, security, flexibility, and developer convenience.
</p>
<h2 id="heading-base64url-encoding">Base64Url Encoding</h2>
<p>.NET 9 introduces the new <code>Base64Url</code> class, which encodes/decodes data into a Base64 variant safe for URL use. This variant avoids the <code>+</code> and <code>/</code> characters present in standard Base64, providing a more suitable encoding for query strings and other URL contexts.</p>
<pre><code class="lang-csharp">ReadOnlySpan&lt;<span class="hljs-keyword">byte</span>&gt; data = ...;
<span class="hljs-keyword">string</span> encoded = Base64Url.EncodeToString(data);
</code></pre>
<h2 id="heading-removal-of-binaryformatter">Removal of BinaryFormatter</h2>
<p>BinaryFormatter is now removed from .NET 9 runtime implementations. Although the APIs still exist, their usage throws exceptions unconditionally. If your application relies on BinaryFormatter, consider migrating to safer and more modern serialization alternatives. For guidance, see the BinaryFormatter migration documentation.</p>
<h2 id="heading-collections-improvements">Collections Improvements</h2>
<p><strong>Span-based Lookups:</strong><br />New capabilities let you look up keys in <code>Dictionary&lt;TKey,TValue&gt;</code> and <code>HashSet&lt;T&gt;</code> using spans, removing the need to allocate strings. With <code>Dictionary&lt;TKey,TValue&gt;.GetAlternateLookup&lt;ReadOnlySpan&lt;char&gt;&gt;()</code>, you can efficiently count words or handle other scenarios with high-performance text processing.</p>
<p><strong>OrderedDictionary:</strong><br />A new <code>OrderedDictionary&lt;TKey,TValue&gt;</code> provides a generic, efficient type for maintaining insertion order while still offering dictionary-level lookups.</p>
<p><strong>PriorityQueue.Remove():</strong><br /><code>PriorityQueue&lt;TElement,TPriority&gt;</code> now includes a <code>Remove</code> method that allows emulating priority updates by removing and re-enqueuing items with a new priority, useful in graph algorithms and similar scenarios.</p>
<p><strong>ReadOnlySet:</strong><br /><code>ReadOnlySet&lt;T&gt;</code> provides a read-only wrapper for sets, similar to how <code>ReadOnlyCollection&lt;T&gt;</code> and <code>ReadOnlyDictionary&lt;TKey,TValue&gt;</code> work for their respective collections.</p>
<h2 id="heading-component-model-and-typedescriptor-trimming-support">Component Model and TypeDescriptor Trimming Support</h2>
<p>For trimming scenarios, <code>TypeDescriptor</code> introduces new opt-in APIs that register types and fetch properties without triggering trimming warnings. This makes self-contained trimmed applications easier to build without losing type information.</p>
<h2 id="heading-cryptography-enhancements">Cryptography Enhancements</h2>
<p><strong>CryptographicOperations.HashData():</strong><br />A new <code>HashData</code> method provides a one-shot hashing API for dynamically chosen algorithms. It streamlines hashing flows and reduces allocations.</p>
<p><strong>KMAC Algorithm:</strong><br />KMAC (KECCAK-based Message Authentication Code) is now supported, enabling keyed hashing with high-security scenarios. KMAC is available where supported by OpenSSL 3.0 or Windows 11 Build 26016+.</p>
<p><strong>AES-GCM and ChaChaPoly1305 on iOS/tvOS/MacCatalyst:</strong><br />IsSupported properties for these algorithms now return true on these Apple platforms, expanding cryptographic coverage on mobile and desktop Apple devices.</p>
<p><strong>X.509 Certificate Loading:</strong><br />A new <code>X509CertificateLoader</code> class provides a "one method, one purpose" approach to loading certificates, avoiding content-sniffing and reducing complexity.</p>
<p><strong>OpenSSL Providers:</strong><br />You can now open keys via OpenSSL providers (like <code>tpm2</code>, <code>pkcs11</code>), improving hardware security integration scenarios.</p>
<p><strong>Windows CNG VBS:</strong><br />New flags in <code>CngKeyCreationOptions</code> enable using virtualization-based security (VBS) for keys in Windows 11, enhancing key protection against admin-level attacks.</p>
<h2 id="heading-date-and-time-new-timespanfrom-overloads">Date and Time: New TimeSpan.From* Overloads</h2>
<p>To avoid floating-point imprecision, new integer-based <code>TimeSpan</code> creation methods allow specifying days, hours, minutes, seconds, milliseconds, and microseconds without floating-point inaccuracies.</p>
<pre><code class="lang-csharp">TimeSpan ts = TimeSpan.FromSeconds(seconds: <span class="hljs-number">101</span>, milliseconds: <span class="hljs-number">832</span>); <span class="hljs-comment">// Precise 00:01:41.832</span>
</code></pre>
<h2 id="heading-dependency-injection-improvements">Dependency Injection Improvements</h2>
<p><code>ActivatorUtilities.CreateInstance</code> constructor resolution now correctly prioritizes constructors marked with <code>[ActivatorUtilitiesConstructorAttribute]</code>. This ensures that the specified constructor is always chosen.</p>
<h2 id="heading-diagnostics-and-instrumentation">Diagnostics and Instrumentation</h2>
<p><strong>Debug.Assert Condition Reporting:</strong><br />If no message is provided, <code>Debug.Assert</code> now includes the textual representation of the failed condition, aiding debugging.</p>
<p><strong>New Activity.AddLink Method:</strong><br />You can now add links to tracing <code>Activity</code> objects after creation, aligning .NET’s diagnostic APIs better with OpenTelemetry standards.</p>
<p><strong>Metrics.Gauge Instrument:</strong><br />A new <code>Gauge&lt;T&gt;</code> instrument supports non-additive metric values (like temperature readings or sound levels), following OpenTelemetry specifications.</p>
<p><strong>Out-of-Proc Meter Wildcard Listening:</strong><br />Meter events can now be listened to via wildcard characters or prefixes, simplifying scenario-specific metric collection with external tools.</p>
<h2 id="heading-linq-extensions">LINQ Extensions</h2>
<p><strong>CountBy and AggregateBy:</strong><br />New LINQ methods <code>CountBy</code> and <code>AggregateBy</code> streamline operations that previously required <code>GroupBy</code>. They allow keyed counting and aggregations without allocating intermediate groupings.</p>
<p><strong>Index():</strong><br /><code>Index</code> enumerates over collections with their indices, simplifying zero-allocation indexing of sequence elements.</p>
<h2 id="heading-logging-source-generator">Logging Source Generator</h2>
<p>The logging source generator now supports classes with primary constructors, allowing for more concise and efficient logging code in C# 13.</p>
<h2 id="heading-miscellaneous-language-features">Miscellaneous Language Features</h2>
<p>C# 13 introduces <code>allows ref struct</code> constraints. Many core library APIs now support ref struct generic parameters. <code>SearchValues</code> expansions improve substring searching and advanced text processing. These enhancements provide more efficient and flexible options for parsers, serializers, and compilers.</p>
<h2 id="heading-networking-updates">Networking Updates</h2>
<p><strong>SocketsHttpHandler in HttpClientFactory:</strong><br /><code>HttpClientFactory</code> now defaults to <code>SocketsHttpHandler</code> for better control and performance of connection pooling and rotation.</p>
<p><strong>System.Net.ServerSentEvents:</strong><br />A new parser simplifies consuming Server-Sent Events (SSE), aiding scenarios like streaming output from AI services or notifications from servers.</p>
<p><strong>TLS Resume with Client Certificates on Linux:</strong><br />TLS session resumption with client certificates is now supported on Linux, improving security and performance for mutual TLS scenarios.</p>
<p><strong>WebSocket Keep-Alive and Timeout:</strong><br />WebSocket APIs now support keep-alive pings and connection abortion on non-responses, ensuring more robust WebSocket connections.</p>
<h2 id="heading-reflection-and-emission">Reflection and Emission</h2>
<p><strong>PersistedAssemblies:</strong><br /><code>PersistedAssemblyBuilder</code> enables generating and saving emitted assemblies to disk, bridging gaps in dynamic assembly creation and code generation scenarios.</p>
<p><strong>TypeName Parsing:</strong><br />The new <code>TypeName</code> class offers a parseable, reflection-like representation of type names that doesn’t require runtime environment involvement, simplifying advanced serializer and compiler scenarios.</p>
<h2 id="heading-regular-expressions">Regular Expressions</h2>
<p><strong>[GeneratedRegex] on Properties:</strong><br />Regex source generation now supports partial properties, in addition to partial methods, for compile-time Regex creation.</p>
<p><strong>Regex.EnumerateSplits:</strong><br /><code>Regex.EnumerateSplits</code> provides allocation-free span-based splitting with ranges, a significant performance enhancement over <code>Regex.Split</code>.</p>
<h2 id="heading-systemtextjson-improvements">System.Text.Json Improvements</h2>
<p><strong>Indentation Options:</strong><br />Fine-grained control over indentation character and size for pretty-printed JSON.</p>
<p><strong>JsonSerializerOptions.Web:</strong><br />A built-in singleton for ASP.NET Core–style serialization defaults (camelCase, etc.).</p>
<p><strong>JsonSchemaExporter:</strong><br />Generate JSON schemas for .NET types, aiding OpenAPI and AI integration scenarios.</p>
<p><strong>Respect Nullable Annotations and Required Constructor Parameters:</strong><br />Options <code>RespectNullableAnnotations</code> and <code>RespectRequiredConstructorParameters</code> allow strict enforcement of nullability and constructor invariants during serialization.</p>
<p><strong>Order JsonObject Properties, Custom Enum Names, Multiple JSON Documents, and More:</strong></p>
<ul>
<li>Ordered dictionary–like APIs for <code>JsonObject</code>.</li>
<li><code>JsonStringEnumMemberNameAttribute</code> for custom enum member names.</li>
<li>Multi-document support in <code>Utf8JsonReader</code>.</li>
</ul>
<h2 id="heading-spans-and-memory-efficiency">Spans and Memory Efficiency</h2>
<p><strong>File Helpers for Spans:</strong><br />Write spans directly to files with <code>File.WriteAllText(ReadOnlySpan&lt;char&gt;)</code> and other overloads, avoiding allocations.</p>
<p><strong>params ReadOnlySpan Overloads:</strong><br />Over 60 new or updated APIs now use <code>params ReadOnlySpan&lt;T&gt;</code> for improved performance without array allocations.</p>
<p><strong>Split Enumeration for Spans:</strong><br /><code>ReadOnlySpan&lt;char&gt;.Split</code> now has enumerator APIs for unknown segment counts, removing the need for allocations.</p>
<h2 id="heading-systemformats">System.Formats</h2>
<p><code>TarEntry.DataOffset</code> now lets you discover the real location of TAR entry data in a stream, supporting advanced large-file scenarios and concurrent reads.</p>
<h2 id="heading-systemguid">System.Guid</h2>
<p>Guid now supports Version 7 GUID generation, producing time-based, sort-friendly GUIDs. Use <code>Guid.CreateVersion7()</code> for such identifiers.</p>
<h2 id="heading-systemio-and-compression">System.IO and Compression</h2>
<p>Transition to zlib-ng for more efficient compression. New compression option types for ZLib and Brotli allow fine-tuned compression level and strategy selection.</p>
<h2 id="heading-systemnumerics">System.Numerics</h2>
<p><strong>BigInteger Limit:</strong><br />A new bit-length limit ensures BigInteger operations remain consistent and well-defined.</p>
<p><strong>New BigMul APIs, Vector Conversion/Create APIs, and Accelerations:</strong><br />Better numeric APIs, faster vector operations, and more built-in SIMD optimizations.</p>
<h2 id="heading-tensors-for-ai">Tensors for AI</h2>
<p><strong>Tensor:</strong><br />A new tensor type enabling efficient data manipulation and interoperability with ML frameworks. Build on <code>TensorPrimitives</code> and other AI-tailored APIs for zero-copy integrations and higher-dimensional computations.</p>
<h2 id="heading-threading">Threading</h2>
<p><strong>Task.WhenEach:</strong><br />Process tasks as they complete using <code>await foreach</code>.</p>
<p><strong>Prioritized Channels:</strong><br /><code>Channel.CreateUnboundedPrioritized</code> supports elements ordered by priority, not just FIFO.</p>
<p><strong>Interlocked on More Types:</strong><br />Interlocked now supports byte, sbyte, short, and ushort, and the generic constraints have been relaxed to support primitive and enum types as well.</p>
<hr />
<p>This extensive set of enhancements in the .NET libraries for .NET 9 caters to performance-focused developers, modern security and cryptography needs, next-gen ML and AI workloads, improved JSON and diagnostics, and more. The changes make the base class libraries more consistent, powerful, and ready for complex, data-intensive scenarios.</p>
<p><a target="_blank" href="/9-whats-new-in-the-sdk-and-tooling-for-dotnet-9">Next → What’s New in the SDK and Tooling for .NET 9</a>  </p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's new in .NET MAUI for .NET 9]]></title><description><![CDATA[← Previous: What’s New in ML.NET
.NET Multi-platform App UI (.NET MAUI) in .NET 9 focuses on improving overall product quality, test coverage, performance, and stability. While previous releases introduced major new capabilities and controls, the emp...]]></description><link>https://read.satishyadav.com/7-whats-new-in-dotnet-maui-for-dotnet-9</link><guid isPermaLink="true">https://read.satishyadav.com/7-whats-new-in-dotnet-maui-for-dotnet-9</guid><category><![CDATA[dotnet]]></category><category><![CDATA[#maui]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:22:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/SpVHcbuKi6E/upload/af93914f45328831ad2254a30e009806.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/6-whats-new-in-ml-net">← Previous: What’s New in ML.NET</a></p>
<p>.NET Multi-platform App UI (.NET MAUI) in .NET 9 focuses on improving overall product quality, test coverage, performance, and stability. While previous releases introduced major new capabilities and controls, the emphasis in .NET 9 is on refining the developer experience, ensuring robust cross-platform performance, and preparing the ecosystem for future enhancements.
</p>
<h2 id="heading-enhanced-quality-and-compatibility">Enhanced Quality and Compatibility</h2>
<p>Key improvements in .NET MAUI 9 revolve around comprehensive bug fixes, expanded test coverage, and enhanced end-to-end scenario testing. The product quality investments are detailed in the official release notes:</p>
<ul>
<li><a target="_blank" href="https://github.com/dotnet/maui/releases/tag/v9.0.100">.NET MAUI 9</a></li>
<li><a target="_blank" href="https://github.com/dotnet/maui/releases/tag/v9.0.100-rc.2">.NET MAUI 9 RC2</a></li>
<li><a target="_blank" href="https://github.com/dotnet/maui/releases/tag/v9.0.100-rc.1">.NET MAUI 9 RC1</a></li>
<li><a target="_blank" href="https://github.com/dotnet/maui/releases">.NET MAUI 9 Previews</a></li>
</ul>
<p><strong>Note on Support Policy:</strong><br />Working with external dependencies like Xcode and Android SDK tools influences .NET MAUI’s support policy, which differs from the standard .NET support lifecycles. For more information, see the <a target="_blank" href="https://github.com/dotnet/maui/blob/main/docs/README.md#maui-support-policy">.NET MAUI support policy</a>.</p>
<p><strong>Minimum Deployment Targets and Tooling Requirements:</strong>  </p>
<ul>
<li><strong>Xcode 16</strong> compatibility is required for building iOS, iPadOS, tvOS, and macOS apps. Xcode 16 requires macOS 14.5 or later.</li>
<li><strong>Deployment targets:</strong> iOS 12.2 and Mac Catalyst 15.0 (macOS 12.0) are now minimum targets, while Android and Windows remain unchanged.</li>
</ul>
<p><strong>Workload and NuGet Packages:</strong><br />.NET MAUI ships as both a .NET workload and multiple NuGet packages, enabling developers to pin projects to specific versions or try experimental builds seamlessly. New projects automatically include the required NuGet dependencies.</p>
<h2 id="heading-new-controls">New Controls</h2>
<p><strong>HybridWebView:</strong><br />The new HybridWebView control allows you to host rich web content (HTML, JS, CSS) within your .NET MAUI app and communicate bidirectionally between JavaScript and C# code. This is ideal for integrating existing React, Vue, or Angular web apps into a cross-platform native shell, leveraging .NET on the back-end.</p>
<p><strong>TitleBar for Windows:</strong><br />A new TitleBar control lets you create a custom title bar for Windows apps. You can add search bars, icons, and menus directly into the title bar area, improving the UI/UX of your desktop apps. Mac Catalyst support will arrive in a future release.</p>
<h2 id="heading-control-enhancements-and-behavioral-changes">Control Enhancements and Behavioral Changes</h2>
<ul>
<li><p><strong>BackButtonBehavior Binding Mode:</strong><br />In Shell apps, <code>IsVisible</code> and <code>IsEnabled</code> on <code>BackButtonBehavior</code> now default to <code>OneWay</code>, making runtime control of the back button easier via data bindings.</p>
</li>
<li><p><strong>BlazorWebView Updates:</strong><br />By default, the BlazorWebView now uses <code>0.0.0.1</code> instead of <code>0.0.0.0</code> for hosting content. The underlying disposal behavior has also changed to reduce deadlocks, but you can revert to the legacy behavior if needed.</p>
</li>
<li><p><strong>iOS Buttons:</strong><br />Button layout on iOS now more accurately respects spacing, padding, border width, and margins. Images in buttons are sized to the max available space.</p>
</li>
<li><p><strong>CollectionView &amp; CarouselView (iOS &amp; Mac Catalyst):</strong><br />Optional new handlers based on UICollectionView APIs offer improved performance and stability. Opt into these handlers to enhance your list and carousel performance.</p>
</li>
<li><p><strong>Soft Keyboard Input:</strong><br />New keyboard types (Password, Date, and Time) are supported on <code>Entry</code> and <code>Editor</code> controls, enabling more precise input scenarios.</p>
</li>
<li><p><strong>Text Justification:</strong><br />Text controls now support <code>Justify</code> alignment, letting you distribute text evenly across the width of the container.</p>
</li>
<li><p><strong>TimePicker Event:</strong><br /><code>TimePicker</code> adds a <code>TimeSelected</code> event for handling changes in selected time values.</p>
</li>
<li><p><strong>WebView Process Termination Handling:</strong><br /><code>WebView</code> introduces a <code>ProcessTerminated</code> event to handle unexpected web process endings and recover gracefully.</p>
</li>
</ul>
<h2 id="heading-compiled-bindings-and-performance">Compiled Bindings and Performance</h2>
<p><strong>Compiled Bindings in Code:</strong><br />.NET MAUI 9 introduces a Func-based approach for defining bindings in code without string paths, improving performance and compile-time validation. Compiled bindings now also support scenarios previously unsupported, like Source-based bindings and multi-bindings.</p>
<p><strong>XAML Compiled Bindings:</strong><br />XAML compiled bindings have fewer restrictions—bindings that set the <code>Source</code> property and multi-bindings are now supported. By default, non-compiled bindings produce build warnings, encouraging you to adopt compiled bindings for better performance and correctness.</p>
<p><strong>Dependency Injection and Handler Disconnection:</strong><br />In Shell apps, page registration with the DI container is no longer mandatory unless you’re customizing lifetime behavior. Handlers now disconnect from their controls automatically in most scenarios (for example, when navigating back), but you can override this with a disconnect policy if desired.</p>
<h2 id="heading-platform-specific-improvements-and-features">Platform-Specific Improvements and Features</h2>
<p><strong>Multi-Window Activation:</strong><br />On Mac Catalyst and Windows, you can activate a specific window using <code>Application.Current?.ActivateWindow(window)</code>.</p>
<p><strong>Native AOT Deployment (iOS and Mac Catalyst):</strong><br />Opt into Native AOT deployment to reduce app size (up to 2.5x smaller), improve startup times (up to 2x faster), and enhance performance. This requires full trim compatibility and no linker warnings.</p>
<p><strong>Native Embedding:</strong><br />.NET MAUI 9 includes full APIs for native embedding scenarios. You can now easily wrap a .NET MAUI view and present it as a native view on Android, iOS, or Mac Catalyst.</p>
<h2 id="heading-project-templates-trimming-and-deprecated-apis">Project Templates, Trimming, and Deprecated APIs</h2>
<p><strong>New Project Templates:</strong><br />The .NET MAUI App project template now includes a sample todo app that uses Syncfusion Toolkit controls and SQLite if you opt in, as well as a .NET MAUI Blazor Hybrid and Web App project template.</p>
<p><strong>Full Trimming Support:</strong><br />Full trimming support is now available. Trimming-incompatible features are removed unless you specify trimmer directives or adopt compiled bindings and new approaches for XAML and data binding.</p>
<p><strong>Deprecated APIs:</strong>  </p>
<ul>
<li><code>Frame</code> is obsolete; use <code>Border</code> instead.</li>
<li><code>MainPage</code> property on <code>Application</code> is obsolete; set the initial page via <code>Window.Page</code>.</li>
<li>Legacy measure calls and compatibility layout classes are deprecated.</li>
<li>Certain hybrid features and dynamic serialization are incompatible with full trimming, and you must use feature switches or alternate patterns.</li>
</ul>
<h2 id="heading-upgrading-from-net-8-to-net-9">Upgrading from .NET 8 to .NET 9</h2>
<p>To upgrade, update your Target Framework Monikers (TFMs), adopt compiled bindings, remove reliance on deprecated APIs, and consider enabling full trimming and Native AOT where beneficial. Detailed guidance is provided in the official migration instructions.</p>
<hr />
<p>In short, .NET MAUI 9 concentrates on quality, stability, and performance improvements, making it easier than ever to build high-quality, well-performing cross-platform apps. The introduction of <code>HybridWebView</code>, <code>TitleBar</code>, enhanced bindings, and improved platform integration paves the way for more flexible and efficient MAUI development moving forward.</p>
<p><a target="_blank" href="/8-whats-new-in-dotnet-libraries-for-dotnet-9">Next → What’s New in .NET Libraries for .NET 9</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's new in ML.NET]]></title><description><![CDATA[← Previous: What’s new in ASP.NET Core 9.0  
ML.NET continues to evolve as a full-featured, open-source machine learning framework for .NET developers, enabling you to create, train, and deploy custom ML models directly in your .NET applications. ML....]]></description><link>https://read.satishyadav.com/6-whats-new-in-ml-net</link><guid isPermaLink="true">https://read.satishyadav.com/6-whats-new-in-ml-net</guid><category><![CDATA[dotnet]]></category><category><![CDATA[ml.net]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:22:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/gVQLAbGVB6Q/upload/9775f7792f89b0f7cc4f0a4f6565f3ee.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/5-whats-new-in-aspnet-core-9-0">← Previous: What’s new in ASP.NET Core 9.0</a>  </p>
<p>ML.NET continues to evolve as a full-featured, open-source machine learning framework for .NET developers, enabling you to create, train, and deploy custom ML models directly in your .NET applications. ML.NET 3.0 and 4.0 bring expanded capabilities for advanced AI scenarios—particularly around deep learning tasks, AutoML improvements, and enhanced tokenization support—making it easier to handle complex text and vision problems.
</p>
<h2 id="heading-new-deep-learning-tasks">New Deep-Learning Tasks</h2>
<p><strong>Deep Learning with TorchSharp</strong><br />ML.NET 3.0 introduces support for several new deep-learning tasks backed by TorchSharp, a .NET library for PyTorch-based deep learning. These tasks include:</p>
<ul>
<li><strong>Object Detection:</strong> Automatically identify objects within images, assigning bounding boxes and categories. This enables a range of computer vision scenarios, from product detection in e-commerce images to recognizing signs in autonomous driving footage.</li>
<li><strong>Named Entity Recognition (NER):</strong> Extract entities like names, places, organizations, and more from text. NER models streamline text processing, making it easier to process documents, support chatbots, and enhance search functionality.</li>
<li><strong>Question Answering (QA):</strong> Build systems capable of reading comprehension—answering questions about given documents or passages. This feature has significant implications for building chatbots, documentation Q&amp;A tools, and intelligent search solutions.</li>
</ul>
<p>All these trainers are included in the <code>Microsoft.ML.TorchSharp</code> package. For more details, check out the <a target="_blank" href="https://devblogs.microsoft.com/dotnet/announcing-ml-net-3-0/">Announcing ML.NET 3.0</a> post.</p>
<h2 id="heading-automl-enhancements">AutoML Enhancements</h2>
<p>AutoML (Automated Machine Learning) simplifies model selection and hyperparameter tuning by automating the training and evaluation pipeline. ML.NET 3.0 updates the AutoML sweeper to handle new tasks, including sentence similarity, question answering, and object detection. With these improvements, you can quickly experiment with various models and configurations using the AutoML API, reducing the time and expertise required to achieve state-of-the-art results.</p>
<p>For more information, see <a target="_blank" href="https://learn.microsoft.com/dotnet/machine-learning/how-to-guides/howto-use-automl-api">How to use the ML.NET Automated Machine Learning (AutoML) API</a>.</p>
<h2 id="heading-enhanced-tokenizer-support">Enhanced Tokenizer Support</h2>
<p>Text tokenization is a crucial step in NLP pipelines, splitting raw text into manageable tokens (words, subwords, or symbols) before feeding it into language models. In ML.NET 4.0, the <code>Microsoft.ML.Tokenizers</code> package introduces significant enhancements:</p>
<ul>
<li><p><strong>Refined APIs and Tiktoken Support:</strong><br />The tokenizer library now supports Tiktoken (the tokenization method used by OpenAI models), enabling more accurate and efficient tokenization for GPT models, such as GPT-4. This lets you integrate local or remote AI services easily, better understand your costs (e.g., Azure OpenAI tokens), and manage prompt context sizes.</p>
</li>
<li><p><strong>Llama Model Tokenizer:</strong><br />The library now supports tokenizing text for Llama-based models, enabling usage of models like LLaMA and Mistral with minimal extra tooling.</p>
</li>
<li><p><strong>CodeGen Tokenizer:</strong><br />With support for CodeGen tokenizers (compatible with models such as codegen-350M-mono and phi-2), you can tokenize code-oriented data and build advanced coding assistants or code-search solutions.</p>
</li>
<li><p><strong>Span-based APIs and Flexible Normalization:</strong><br />New overloads accept <code>Span&lt;char&gt;</code> inputs and allow you to toggle normalization and pretokenization steps. These capabilities give fine-grained control over how text is processed, improving performance and adaptability for various NLP workflows.</p>
</li>
<li><p><strong>Migration from DeepDev or SharpToken:</strong><br />The ML.NET tokenization ecosystem has consolidated around Microsoft.ML.Tokenizers. If you’ve previously used DeepDev or SharpToken, a migration guide is provided to help you smoothly transition to <code>Microsoft.ML.Tokenizers</code>.</p>
</li>
</ul>
<p>For examples and more details, see <a target="_blank" href="https://devblogs.microsoft.com/dotnet/announcing-ml-net-2-0/">Announcing ML.NET 2.0</a> and the updated <a target="_blank" href="https://learn.microsoft.com/dotnet/machine-learning/how-to-guides/">tokenization library documentation</a>.</p>
<h2 id="heading-model-builder-in-visual-studio">Model Builder in Visual Studio</h2>
<p>Model Builder, the Visual Studio extension that provides a UI-based machine learning workflow, now consumes ML.NET 3.0. Starting from Model Builder version 17.18.0, you can leverage newly introduced scenarios like question answering (QA) and named entity recognition (NER) directly within Visual Studio. This streamlines building advanced NLP pipelines without leaving your IDE.</p>
<hr />
<p>In summary, ML.NET’s recent updates extend the framework’s capabilities into advanced AI tasks such as object detection, NER, and QA, while improving automation via AutoML and simplifying text preprocessing with enhanced tokenization. These updates open the door to more sophisticated and production-ready machine learning solutions directly integrated into your .NET applications.</p>
<p><a target="_blank" href="/7-whats-new-in-dotnet-maui-for-dotnet-9">Next → What’s New in .NET MAUI for .NET 9</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in EF Core 9]]></title><description><![CDATA[← Previous: What’s New in C# 13  
Entity Framework Core 9 (EF9) continues to evolve as the go-to data access technology for .NET, delivering improvements in querying, modeling, migrations, cloud-native integrations, and performance. Building on EF Co...]]></description><link>https://read.satishyadav.com/4-whats-new-in-ef-core-9</link><guid isPermaLink="true">https://read.satishyadav.com/4-whats-new-in-ef-core-9</guid><category><![CDATA[.NET]]></category><category><![CDATA[efcore]]></category><category><![CDATA[dotnet]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:05:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cckf4TsHAuw/upload/277ea09289d871f0ffc4e005a01b36a5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/3-whats-new-in-csharp-13">← Previous: What’s New in C# 13</a>  </p>
<p>Entity Framework Core 9 (EF9) continues to evolve as the go-to data access technology for .NET, delivering improvements in querying, modeling, migrations, cloud-native integrations, and performance. Building on EF Core 8, EF9 targets .NET 8 but can also be used with .NET 9, giving you flexibility in which runtime you adopt.

EF9 introduces significant enhancements for working with Azure Cosmos DB, LINQ translations, hierarchical partition keys, and AOT compilation scenarios. It also brings refinements to migrations, model building, and tooling, ensuring a smoother experience for modern data-driven applications.</p>
<h2 id="heading-release-and-availability">Release and Availability</h2>
<p>EF9 is scheduled for release in November 2024. Until then, you can use EF9 through daily builds, which contain the latest features and API tweaks. We strongly recommend testing new features against these daily builds to ensure you’re working with the most up-to-date functionality. EF9 supports both .NET 8 (LTS) and .NET 9 (STS), so you can choose the runtime that best fits your needs.</p>
<h2 id="heading-major-highlights">Major Highlights</h2>
<p><strong>1. Azure Cosmos DB for NoSQL</strong><br />EF9 brings a comprehensive overhaul of the Azure Cosmos DB provider, including:</p>
<ul>
<li><strong>Efficient Partition-Key-Aware Queries:</strong> EF9 automatically detects partition key predicates in LINQ queries, using them to route queries only to the relevant partition. This reduces request units (RUs) and improves performance.</li>
<li><strong>Point Reads with Partition Keys and IDs:</strong> If both partition key and ID are specified, EF can perform a direct, cost-effective point read rather than issuing a full SQL query.</li>
<li><strong>Hierarchical Partition Keys:</strong> EF9 fully supports hierarchical partition keys, allowing you to take advantage of Azure Cosmos DB’s multi-level partitioning for finer-grained data partitioning and performance optimization.</li>
<li><strong>Expanded LINQ Support:</strong> The provider now translates more LINQ operations, supports querying over primitive and non-primitive collections, and offers improved function translations (e.g., <code>string.Contains</code>, date/time components).</li>
<li><strong>JSON Alignment and Simpler IDs:</strong> EF9 uses a more natural JSON mapping, removing discriminators from <code>id</code> fields and changing default discriminator names to <code>$type</code>. This improves interoperability with external systems and better aligns with JSON standards.</li>
<li><strong>Vector Similarity Search (Preview):</strong> Azure Cosmos DB vector search can be integrated with EF9, allowing vector-based semantic searches natively.</li>
<li><strong>Pagination and Continuation Tokens:</strong> Paginate through results efficiently using continuation tokens, rather than relying on costly <code>Skip/Take</code> operations.</li>
<li><strong>Safer Raw SQL Queries:</strong> Use <code>FromSql</code> (rather than <code>FromSqlRaw</code>) for parameterized and safe raw SQL operations.</li>
</ul>
<p><strong>2. LINQ and Query Translation Improvements</strong><br />EF9 continues to refine its LINQ provider, improving SQL translation and performance:</p>
<ul>
<li><strong>Pre-Compiled Queries and AOT:</strong> EF9 introduces experimental support for NativeAOT and pre-compiled queries. LINQ queries can be pre-compiled into interceptors containing SQL and materialization logic, significantly improving startup performance.</li>
<li><strong>Table and Projection Pruning:</strong> EF9 removes unnecessary JOINs and projections, generating cleaner and potentially more performant SQL.</li>
<li><strong>GREATEST/LEAST Functions:</strong> New translations leverage SQL Server 2022’s <code>GREATEST</code> and <code>LEAST</code> functions for simpler and more efficient code.</li>
<li><strong>Parameterization Control:</strong> Control parameterization using <code>EF.Parameter</code> and <code>EF.Constant</code> to force or prevent parameterization, balancing query plan reuse against potential performance gains.</li>
<li><strong>Inlined Subqueries and Aggregates:</strong> Complex queries involving aggregates and subqueries are now translated more naturally, often requiring fewer database round trips.</li>
<li><strong>Consistent Null and Comparison Semantics:</strong> EF9 ensures consistent behavior with nullable comparisons, matching C# semantics and aligning results across different providers.</li>
</ul>
<p><strong>3. Enhanced Modeling and Compilation</strong><br />Model building sees new features to reduce startup time and simplify configuration:</p>
<ul>
<li><strong>Auto-Compiled Models:</strong> EF9 can automatically discover and use compiled models without requiring manual <code>UseModel</code> calls. With MSBuild integration, compiled models are automatically regenerated as the model changes, reducing friction.</li>
<li><strong>Read-Only Primitive Collections:</strong> Beyond arrays and mutable lists, EF9 supports read-only collections and lists of primitive types. This provides more flexibility in designing read-only domain models.</li>
<li><strong>SQL Server Fill-Factor Support:</strong> Configure <code>fill-factor</code> for keys and indexes on SQL Server, controlling how index pages are filled and improving index maintenance and performance.</li>
<li><strong>More Extensible Conventions:</strong> EF9 makes it easier to build custom conventions or extend existing ones, improving control over how models are constructed.</li>
</ul>
<p><strong>4. Migrations and Seeding</strong><br />Migrations and database initialization also benefit from enhancements:</p>
<ul>
<li><strong>Concurrent Migration Protection:</strong> EF9 introduces locking to prevent multiple migrations from running concurrently, protecting your database from corruption.</li>
<li><strong>Warnings for Non-Transactional Operations:</strong> EF9 warns if a migration contains non-transactional operations alongside transactional ones, encouraging safer migration patterns.</li>
<li><strong>Improved Data Seeding APIs:</strong> Use <code>.UseSeeding</code> and <code>.UseAsyncSeeding</code> to conveniently insert initial data during context initialization.</li>
</ul>
<p><strong>5. Tooling Improvements</strong><br />The <code>dotnet ef</code> command experiences fewer unnecessary rebuilds, improving developer productivity. The team welcomes feedback to ensure these improvements don’t have unintended consequences.</p>
<h2 id="heading-other-notable-updates">Other Notable Updates</h2>
<ul>
<li><strong>HierarchyId Improvements:</strong> EF9 introduces sugar methods to easily generate child HierarchyId nodes, making hierarchical data handling more intuitive.</li>
<li><strong>More Efficient Negation and Conditional Translations:</strong> EF9 refines the SQL it generates around logical negations, CASE statements, and conditions, often leading to shorter, more direct SQL.</li>
<li><strong>Better Azure SQL and Azure Synapse Support:</strong> EF9 can now target Azure SQL or Azure Synapse specifically, enabling better SQL generation tailored to these environments.</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>EF Core 9 represents a substantial leap forward in cloud readiness, performance optimization, AOT integration, and interoperability with JSON-based and vector-based workloads. Whether you’re building with Azure Cosmos DB or optimizing SQL queries on relational databases, EF9 delivers greater control, safer migrations, and improved startup times.</p>
<p>In the next installment, we’ll explore <strong>What’s New in ASP.NET Core 9.0</strong>, examining how the latest changes improve web development, scaling, and performance on the modern web platform.</p>
<p><a target="_blank" href="/5-whats-new-in-aspnet-core-9-0">Next → What’s new in ASP.NET Core 9.0</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in ASP.NET Core 9.0]]></title><description><![CDATA[← Previous: What’s New in EF Core 9  
ASP.NET Core 9.0 streamlines delivering static assets, enhances Blazor development workflows, expands built-in OpenAPI capabilities, improves SignalR tracing and AOT support, and refines authentication and author...]]></description><link>https://read.satishyadav.com/5-whats-new-in-aspnet-core-9-0</link><guid isPermaLink="true">https://read.satishyadav.com/5-whats-new-in-aspnet-core-9-0</guid><category><![CDATA[.NET]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[asp.net core]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 10:02:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/-RBuQ2PK_L8/upload/a09a53363c756fdbc7bb304f898c75e5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/4-whats-new-in-ef-core-9">← Previous: What’s New in EF Core 9</a>  </p>
<p>ASP.NET Core 9.0 streamlines delivering static assets, enhances Blazor development workflows, expands built-in OpenAPI capabilities, improves SignalR tracing and AOT support, and refines authentication and authorization features. In addition, the release introduces performance optimizations, improved debugging and metrics, and various quality-of-life improvements for developers.
</p>
<h2 id="heading-static-asset-delivery-optimization">Static Asset Delivery Optimization</h2>
<p>Delivering static assets efficiently is a key part of building high-performance web applications. ASP.NET Core 9.0 introduces <code>MapStaticAssets</code>, a new endpoint convention that can replace <code>UseStaticFiles</code> in most scenarios. This feature leverages build-time preprocessing to compress and optimize your site’s static resources, including CSS and JavaScript files. Benefits include:</p>
<ul>
<li><p><strong>Build-time Compression:</strong><br />CSS and JS files are compressed (gzip or brotli) at build time, eliminating the need for on-the-fly compression. This saves CPU cycles and reduces bandwidth usage.</p>
</li>
<li><p><strong>Content-Based ETags:</strong><br />ETag headers are generated based on the file’s SHA-256 hash, ensuring the browser re-downloads a file only if its content changes.</p>
</li>
<li><p><strong>Caching and Stale Asset Prevention:</strong><br />The runtime sets optimal caching headers and uses asset fingerprints to ensure clients get updated content when files change.</p>
</li>
</ul>
<p><code>MapStaticAssets</code> is ideal for assets known at build and publish time. For more dynamic scenarios or assets served from external sources, <code>UseStaticFiles</code> remains a good fit. By default, the optimization works automatically, providing out-of-the-box size reductions of up to 80–90% compared to uncompressed files. This improvement benefits mobile and low-bandwidth environments significantly.</p>
<h2 id="heading-blazor-enhancements">Blazor Enhancements</h2>
<p><strong>.NET MAUI Blazor Hybrid &amp; Web App Solution Template:</strong><br />A new template allows you to create .NET MAUI native and Blazor Web apps that share the same UI layer. This solution template offers:</p>
<ul>
<li>A unified, shared Razor Class Library (RCL) for UI components.</li>
<li>Automatic generation of a Blazor Web App (global interactivity) and a .NET MAUI Blazor Hybrid app.</li>
<li>Dependency injection demos to show how to handle environment-specific services.</li>
</ul>
<p><strong>Detecting Render Modes, Interactivity, and Location:</strong><br />ASP.NET Core 9.0 provides APIs to detect a component’s execution environment, whether it’s interactive, and which render mode it uses. This makes it easier to write components that behave differently depending on their execution context.</p>
<p><strong>Improved Reconnection for Server-Side Blazor:</strong><br />The reconnection experience for Blazor Server has been refined:</p>
<ul>
<li>Immediate reconnection attempts when revisiting a sleeping tab.</li>
<li>Automatic page refresh if the server has released the circuit.</li>
<li>An adaptive backoff strategy for retry intervals and modernized reconnection UI.</li>
</ul>
<p><strong>Authentication State Serialization:</strong><br />New APIs make it simpler to add authentication to Blazor Web Apps. You can serialize the authentication state on the server and deserialize it in the browser, enabling pre-initialized authentication states without custom code. This integration works seamlessly with global interactivity and the Individual Accounts authentication scheme.</p>
<p><strong>Static SSR Pages in Globally-Interactive Blazor Apps:</strong><br />You can now opt certain pages out of global interactivity and render them using only server-side static SSR. This approach is useful for pages that rely heavily on the request/response cycle (for example, operations involving cookies) and cannot be interactively updated.</p>
<p><strong>Constructor Injection in Razor Components:</strong><br />Razor components now support dependency injection via constructors, providing a familiar and streamlined pattern for injecting services into components.</p>
<p><strong>WebSocket Compression and CSP for Interactive Server Components:</strong><br />By default, Interactive Server components now use WebSocket compression and set a default CSP frame-ancestors policy. You can disable compression or tighten CSP directives further, balancing security and performance.</p>
<p><strong>Keyboard Composition Events and InputNumber Enhancements:</strong>  </p>
<ul>
<li><code>KeyboardEventArgs.IsComposing</code> helps handle international character input scenarios more accurately.</li>
<li><code>InputNumber&lt;TValue&gt;</code> now supports <code>type="range"</code>, enabling range inputs like sliders with integrated form validation and model binding.</li>
</ul>
<p><strong>Enhanced Navigation Events:</strong><br />JavaScript callbacks can be triggered before and after “enhanced navigation,” improving how you handle navigation events in Blazor SSR scenarios.</p>
<h2 id="heading-signalr-improvements">SignalR Improvements</h2>
<p><strong>Polymorphic Type Support in Hubs:</strong><br />Hub methods can accept base classes, allowing polymorphic binding of derived types. Annotate classes with <code>[JsonPolymorphic]</code> and <code>[JsonDerivedType]</code> to enable this scenario.</p>
<p><strong>Tracing with OpenTelemetry:</strong><br />New <code>ActivitySource</code> instrumentation for both server and client hubs helps with distributed tracing. You can see how methods and calls link together across the network, making debugging and telemetry much easier.</p>
<p><strong>Native AOT and Trimming Support:</strong><br />SignalR now supports trimming and native AOT scenarios, reducing application size and startup time while maintaining real-time communication capabilities.</p>
<h2 id="heading-openapi-integration">OpenAPI Integration</h2>
<p>ASP.NET Core 9.0 introduces first-class OpenAPI document generation via <code>Microsoft.AspNetCore.OpenApi</code>. This new capability:</p>
<ul>
<li>Generates OpenAPI documents for controller-based or minimal APIs.</li>
<li>Integrates with the .NET toolchain to generate documents at build time.</li>
<li>Supports customization through document, operation, and schema transformers.</li>
<li>Works seamlessly with trimming and native AOT.</li>
</ul>
<h2 id="heading-authentication-and-authorization-updates">Authentication and Authorization Updates</h2>
<p><strong>Pushed Authorization Requests (PAR) for OpenID Connect:</strong><br />The <code>OpenIdConnectHandler</code> now supports Pushed Authorization Requests, improving security by sending authorization parameters through back channels rather than the browser’s front channel. This feature is enabled by default if the Identity Provider supports PAR and can be disabled if necessary.</p>
<p><strong>OAuth/OIDC Parameter Customization:</strong><br />A new <code>AdditionalAuthorizationParameters</code> option allows adding arbitrary query parameters without writing custom events or handlers.</p>
<p><strong>HTTP.sys Extended Authentication Flags:</strong><br />Configure Kerberos credential caching and credential capturing via <code>EnableKerberosCredentialCaching</code> and <code>CaptureCredentials</code> options, optimizing Windows authentication scenarios.</p>
<h2 id="heading-miscellaneous-improvements">Miscellaneous Improvements</h2>
<p><strong>HybridCache (Preview):</strong><br />A new HybridCache API merges the best of <code>IDistributedCache</code> and <code>IMemoryCache</code> with features like stampede protection, customizable serialization, and performance optimizations. It’s intended to simplify caching patterns and minimize duplication of logic.</p>
<p><strong>Developer Exception Page Enhancements:</strong><br />The developer exception page now includes endpoint metadata, improved text wrapping, and consistent formatting, making debugging easier.</p>
<p><strong>Dictionary Debugging Improvements:</strong><br />Key-value collections (headers, query strings, cookies, etc.) have improved debugging layouts, making their contents more readable in Visual Studio’s debugger.</p>
<p><strong>Graceful Shutdown with IIS &amp; ANCM:</strong><br />A built-in delay helps avoid 503 errors during app restarts or recycles on IIS, configurable via <code>shutdownDelay</code>.</p>
<p><strong>Analyzer for Overridden Authorization:</strong><br />A new analyzer warns when <code>[Authorize]</code> attributes are effectively overridden by <code>[AllowAnonymous]</code> attributes placed farther away, preventing unintentional security lapses.</p>
<p><strong>Connection Metrics and Named Pipe Endpoints in Kestrel:</strong><br />Kestrel’s improved <code>kestrel.connection.duration</code> metric includes error types, helping diagnose connection issues without verbose logging. Named pipe endpoints now support advanced customization options.</p>
<p><strong>ExceptionHandlerMiddleware Customization:</strong><br />Configure custom status codes returned by <code>ExceptionHandlerMiddleware</code> based on the exception type.</p>
<p><strong>Opt-Out of HTTP Metrics and Other Features:</strong></p>
<ul>
<li>Metrics can be disabled per endpoint or dynamically per request.</li>
<li>Data protection keys can be deleted after careful consideration.</li>
<li>Middleware supports keyed DI injection.</li>
<li><code>dotnet dev-certs https --trust</code> now works on Linux to trust the ASP.NET Core development certificate in browsers and the system.</li>
</ul>
<p><strong>Template Updates:</strong><br />The .NET 9 templates now use the latest versions of Bootstrap, jQuery, and jQuery Validation, ensuring you start with modern, secure, and performant front-end dependencies.</p>
<p><a target="_blank" href="/6-whats-new-in-ml-net">Next → What’s New in ML.NET</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in C# 13]]></title><description><![CDATA[← Previous: What’s New in the .NET 9 Runtime  
C# 13 introduces a collection of language enhancements that streamline code patterns, enable more powerful generics, improve low-level control, and provide smoother integrations with newer runtime featur...]]></description><link>https://read.satishyadav.com/3-whats-new-in-csharp-13</link><guid isPermaLink="true">https://read.satishyadav.com/3-whats-new-in-csharp-13</guid><category><![CDATA[c#13]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[C#]]></category><category><![CDATA[dotnet9]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 09:59:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/b18TRXc8UPQ/upload/25de988f133678341f0037f5c044ff20.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/2-whats-new-in-dotnet-9-runtime">← Previous: What’s New in the .NET 9 Runtime</a>  </p>
<p>C# 13 introduces a collection of language enhancements that streamline code patterns, enable more powerful generics, improve low-level control, and provide smoother integrations with newer runtime features. These improvements are fully supported on .NET 9, so you can experiment with them using the latest .NET 9 SDK and Visual Studio 2022 releases.
</p>
<h2 id="heading-overview">Overview</h2>
<p>C# 13 adds multiple new features and relaxes certain restrictions, making it easier to write concise, high-performance, and safe code. Key enhancements include:</p>
<ul>
<li><strong><code>params</code> Collections</strong>: Broader support for <code>params</code> with various collection types beyond arrays.</li>
<li><strong>New Lock Type and Semantics</strong>: Integration with the new <code>System.Threading.Lock</code> type for improved synchronization.</li>
<li><strong>New Escape Sequence <code>\e</code></strong>: A simplified escape sequence for the ESC character.</li>
<li><strong>Method Group Natural Type Improvements</strong>: Refined logic for determining a method group’s natural type.</li>
<li><strong>Implicit Indexer Access in Object Initializers</strong>: Using the <code>^</code> operator (from-end indexing) directly in object initializers.</li>
<li><strong><code>ref</code> and Unsafe Contexts in Iterators and Async Methods</strong>: More flexible usage of <code>ref struct</code> and unsafe contexts in async and iterator methods.</li>
<li><strong><code>allows ref struct</code> Anti-Constraint</strong>: Enabling <code>ref struct</code> types as generic type parameters.</li>
<li><strong>Implementing Interfaces on <code>ref struct</code> Types</strong>: Allowing <code>ref struct</code> to implement interfaces (with some restrictions).</li>
<li><strong>Partial Properties and Indexers</strong>: Extending partial method concepts to properties and indexers.</li>
<li><strong>Overload Resolution Priority</strong>: Letting library authors prioritize certain overloads.</li>
<li><strong>Preview: <code>field</code> Contextual Keyword</strong>: Introducing a preview feature for directly accessing compiler-generated backing fields.</li>
</ul>
<p>Each of these changes builds on the language’s existing strengths, providing more expressive and efficient patterns while maintaining safety and compatibility.</p>
<h2 id="heading-params-collections"><code>params</code> Collections</h2>
<p>Previously, the <code>params</code> modifier was restricted to arrays. With C# 13, <code>params</code> can be applied to a broader range of collection types, including <code>System.Span&lt;T&gt;</code>, <code>System.ReadOnlySpan&lt;T&gt;</code>, and any type that implements <code>IEnumerable&lt;T&gt;</code> and has an <code>Add</code> method. This flexibility allows developers to choose data structures that better fit their performance or memory requirements.</p>
<p>For example, you can declare a method that accepts a <code>ReadOnlySpan&lt;T&gt;</code> via <code>params</code>:</p>
<pre><code class="lang-csharp"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">Concat</span>&lt;<span class="hljs-title">T</span>&gt;(<span class="hljs-params"><span class="hljs-keyword">params</span> ReadOnlySpan&lt;T&gt; items</span>)</span>
{
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; items.Length; i++)
    {
        Console.Write(items[i]);
        Console.Write(<span class="hljs-string">" "</span>);
    }
    Console.WriteLine();
}
</code></pre>
<p>When using interface types like <code>IEnumerable&lt;T&gt;</code> as <code>params</code> parameters, the compiler automatically synthesizes the storage for supplied arguments, simplifying code while still providing flexibility.</p>
<h2 id="heading-new-lock-type-and-semantics">New Lock Type and Semantics</h2>
<p>The .NET 9 runtime introduces a new <code>System.Threading.Lock</code> type for thread synchronization, and C# 13 integrates with it seamlessly. When you use the <code>lock</code> statement on a <code>Lock</code> object, the compiler uses the <code>Lock.EnterScope()</code> API and a <code>ref struct</code> to implement the lock’s scope, rather than relying on <code>System.Threading.Monitor</code>. This leads to more efficient synchronization and aligns lock semantics with the new runtime capabilities—no additional code changes are required aside from using the new type in your <code>lock</code> statements.</p>
<h2 id="heading-new-escape-sequence-e">New Escape Sequence: <code>\e</code></h2>
<p>The escape character <code>ESC</code> (U+001B) can now be represented with the <code>\e</code> escape sequence. Previously, you had to rely on <code>\u001b</code> or <code>\x1b</code>, which could introduce ambiguity if followed by hexadecimal digits. This new escape sequence removes that ambiguity and makes code clearer:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">string</span> message = <span class="hljs-string">"\e[31mRed text\e[0m"</span>;
</code></pre>
<h2 id="heading-method-group-natural-type-improvements">Method Group Natural Type Improvements</h2>
<p>C# 13 refines how the compiler determines a method group’s natural type. Previously, if the compiler needed a “natural type” for a method group, it considered all candidate methods and their scopes simultaneously, which could lead to convoluted rules and less predictable results.</p>
<p>Now, the compiler prunes non-applicable candidate methods at each scope before moving outward, more closely mirroring standard overload resolution. This change yields more intuitive behavior for complex method group scenarios involving generics and constraints.</p>
<h2 id="heading-implicit-indexer-access-in-object-initializers">Implicit Indexer Access in Object Initializers</h2>
<p>C# 13 allows using from-end indexing (the <code>^</code> operator) within object initializers, making it easier to express initialization logic that references elements from the end of a sequence. For example:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">var</span> countdown = <span class="hljs-keyword">new</span> TimerRemaining()
{
    buffer =
    {
        [<span class="hljs-meta">^1</span>] = <span class="hljs-number">0</span>,
        [<span class="hljs-meta">^2</span>] = <span class="hljs-number">1</span>,
        [<span class="hljs-meta">^3</span>] = <span class="hljs-number">2</span>,
        [<span class="hljs-meta">^4</span>] = <span class="hljs-number">3</span>,
        [<span class="hljs-meta">^5</span>] = <span class="hljs-number">4</span>,
        [<span class="hljs-meta">^6</span>] = <span class="hljs-number">5</span>,
        [<span class="hljs-meta">^7</span>] = <span class="hljs-number">6</span>,
        [<span class="hljs-meta">^8</span>] = <span class="hljs-number">7</span>,
        [<span class="hljs-meta">^9</span>] = <span class="hljs-number">8</span>,
        [<span class="hljs-meta">^10</span>] = <span class="hljs-number">9</span>
    }
};
</code></pre>
<p>This feature eliminates the need to reindex arrays or collections from the front, simplifying initialization for patterns like reverse ordering.</p>
<h2 id="heading-ref-and-unsafe-contexts-in-iterators-and-async-methods"><code>ref</code> and Unsafe Contexts in Iterators and Async Methods</h2>
<p>Before C# 13, iterators (<code>yield return</code>) and async methods were more restrictive about <code>ref</code> locals, <code>ref struct</code> usage, and unsafe contexts. C# 13 relaxes these rules, enabling scenarios where:</p>
<ul>
<li>Async methods can declare <code>ref local</code> variables or <code>ref struct</code> variables, as long as they don’t cross <code>await</code> boundaries.</li>
<li>Iterator methods can now contain unsafe contexts, as long as all <code>yield return</code> or <code>yield break</code> statements remain in a safe context.</li>
</ul>
<p>These changes allow <code>System.Span&lt;T&gt;</code> and similar <code>ref struct</code> types to be more widely used, improving performance without sacrificing safety.</p>
<h2 id="heading-allows-ref-struct-anti-constraint"><code>allows ref struct</code> Anti-Constraint</h2>
<p>Generic constraints in C# 13 now include the <code>allows ref struct</code> keyword, which permits <code>ref struct</code> types as generic type arguments. This capability makes it possible to write generic algorithms that leverage <code>Span&lt;T&gt;</code> or <code>ReadOnlySpan&lt;T&gt;</code> without resorting to reflection or unsafe code.</p>
<p>For example:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">C</span>&lt;<span class="hljs-title">T</span>&gt; <span class="hljs-keyword">where</span> <span class="hljs-title">T</span> : <span class="hljs-title">allows</span> <span class="hljs-title">ref</span> <span class="hljs-title">struct</span>
{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">M</span>(<span class="hljs-params">scoped T p</span>)</span>
    {
        <span class="hljs-comment">// p is a ref struct type and must follow ref safety rules</span>
    }
}
</code></pre>
<p>This unlocks new avenues for performance-sensitive code that works with stack-based data structures.</p>
<h2 id="heading-implementing-interfaces-on-ref-struct-types">Implementing Interfaces on <code>ref struct</code> Types</h2>
<p>C# 13 allows <code>ref struct</code> types to implement interfaces. However, a <code>ref struct</code> can’t be converted to the interface type at runtime because that would require boxing, violating ref safety. Furthermore, <code>ref struct</code> types must implement all methods of the interface, including those with default implementations.</p>
<p>This feature closes a gap in type capabilities, enabling <code>ref struct</code> types to adhere to interface contracts without relying on non-<code>ref struct</code> wrappers or complex workarounds.</p>
<h2 id="heading-partial-properties-and-indexers">Partial Properties and Indexers</h2>
<p>You can now declare partial properties and indexers, analogous to how partial methods work. One part can declare the signature, while another part provides the implementation. This feature enhances modularity and code organization, especially in large codebases where splitting property or indexer logic across multiple files can improve maintainability.</p>
<h2 id="heading-overload-resolution-priority">Overload Resolution Priority</h2>
<p>With <code>OverloadResolutionPriorityAttribute</code>, library authors can influence the compiler’s overload resolution to prefer certain overloads over others. This feature helps guide consumers toward newer, more efficient APIs without introducing breaking changes. It should be used judiciously to maintain code clarity.</p>
<h2 id="heading-preview-feature-field-keyword">Preview Feature: <code>field</code> Keyword</h2>
<p>C# 13 introduces <code>field</code> as a contextual keyword in property accessors, allowing direct access to the compiler-generated backing field without declaring it explicitly. For example:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">public</span> <span class="hljs-keyword">partial</span> <span class="hljs-keyword">class</span> <span class="hljs-title">C</span>
{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">partial</span> <span class="hljs-keyword">string</span> Name { <span class="hljs-keyword">get</span>; <span class="hljs-keyword">set</span>; }
}

<span class="hljs-keyword">public</span> <span class="hljs-keyword">partial</span> <span class="hljs-keyword">class</span> <span class="hljs-title">C</span>
{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">partial</span> <span class="hljs-keyword">string</span> Name
    {
        <span class="hljs-keyword">get</span> =&gt; field;
        <span class="hljs-keyword">set</span> =&gt; field = <span class="hljs-keyword">value</span>.Trim();
    }
}
</code></pre>
<p>This feature is currently in preview, and feedback from developers will guide its final design and adoption.</p>
<h2 id="heading-getting-started">Getting Started</h2>
<p>You can try out these C# 13 features by installing the <a target="_blank" href="https://aka.ms/dotnet-download">.NET 9 SDK</a> and using the latest version of Visual Studio 2022. For more details on feature availability, refer to the <a target="_blank" href="https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version">C# language versioning documentation</a>.</p>
<p>Breaking changes and additional documentation can be found in the <a target="_blank" href="https://learn.microsoft.com/dotnet/core/compatibility/">breaking changes article</a> and the Roslyn feature status pages, which track when features are merged and their current preview status.</p>
<h2 id="heading-summary">Summary</h2>
<p>C# 13 brings a wide range of enhancements that improve language flexibility, performance potential, and developer productivity. Whether you’re working with new runtime features, exploring more efficient synchronization primitives, or leveraging <code>ref struct</code> types in more scenarios, C# 13 provides tools that streamline these tasks.</p>
<p>In the next installment, we’ll look into <strong>What’s New in EF Core 9</strong>, including updates for Azure Cosmos DB, AOT compilation, and more.</p>
<p><a target="_blank" href="/4-whats-new-in-ef-core-9">Next → What’s New in EF Core 9</a>  </p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in the .NET 9 Runtime]]></title><description><![CDATA[← Previous: What's New in .NET 9  
The .NET 9 runtime introduces a range of features and optimizations aimed at improving performance, reducing application size, enhancing security, and providing more flexible deployment options. These enhancements t...]]></description><link>https://read.satishyadav.com/2-whats-new-in-dotnet-9-runtime</link><guid isPermaLink="true">https://read.satishyadav.com/2-whats-new-in-dotnet-9-runtime</guid><category><![CDATA[.NET]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[runtime]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 09:57:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/505eectW54k/upload/6375bb3735f0a857f46aa8dfa20ca1ba.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="/1-whats-new-in-dotnet-9">← Previous: What's New in .NET 9</a>  </p>
<p>The .NET 9 runtime introduces a range of features and optimizations aimed at improving performance, reducing application size, enhancing security, and providing more flexible deployment options. These enhancements target both core runtime components and the JIT compiler, delivering faster execution times, smaller footprints, and safer execution environments.
</p>
<h2 id="heading-attribute-model-for-feature-switches-with-trimming-support">Attribute Model for Feature Switches with Trimming Support</h2>
<p>In .NET 9, two new attributes—<code>FeatureSwitchDefinitionAttribute</code> and <code>FeatureGuardAttribute</code>—help developers define feature switches that integrate with trimming and Native AOT. By using these attributes, you can toggle areas of functionality at build time, removing unused code paths and reducing application size.</p>
<ul>
<li><p><strong><code>FeatureSwitchDefinitionAttribute</code></strong>:<br />This attribute treats a feature-switch property as a compile-time constant during trimming. When a feature is disabled in the app’s configuration, related code paths are removed from the final binary. Consider the following code:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">if</span> (Feature.IsSupported)
    Feature.Implementation();

<span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Feature</span>
{
    [<span class="hljs-meta">FeatureSwitchDefinition(<span class="hljs-meta-string">"Feature.IsSupported"</span>)</span>]
    <span class="hljs-keyword">internal</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">bool</span> IsSupported =&gt; AppContext.TryGetSwitch(<span class="hljs-string">"Feature.IsSupported"</span>, <span class="hljs-keyword">out</span> <span class="hljs-keyword">bool</span> isEnabled) ? isEnabled : <span class="hljs-literal">true</span>;

    <span class="hljs-function"><span class="hljs-keyword">internal</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">Implementation</span>(<span class="hljs-params"></span>)</span> { <span class="hljs-comment">/* ... */</span> }
}
</code></pre>
<p>By setting <code>&lt;RuntimeHostConfigurationOption Include="Feature.IsSupported" Value="false" Trim="true" /&gt;</code> in the project file, <code>Feature.IsSupported</code> is effectively treated as false, and the call to <code>Feature.Implementation()</code> is removed after trimming.</p>
</li>
<li><p><strong><code>FeatureGuardAttribute</code></strong>:<br />This attribute identifies a feature-switch property as a guard for code annotated with <code>RequiresUnreferencedCodeAttribute</code>, <code>RequiresAssemblyFilesAttribute</code>, or <code>RequiresDynamicCodeAttribute</code>. For example:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">if</span> (Feature.IsSupported)
    Feature.Implementation();

<span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Feature</span>
{
    [<span class="hljs-meta">FeatureGuard(typeof(RequiresDynamicCodeAttribute))</span>]
    <span class="hljs-keyword">internal</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">bool</span> IsSupported =&gt; RuntimeFeature.IsDynamicCodeSupported;

    [<span class="hljs-meta">RequiresDynamicCode(<span class="hljs-meta-string">"Feature requires dynamic code support."</span>)</span>]
    <span class="hljs-function"><span class="hljs-keyword">internal</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">Implementation</span>(<span class="hljs-params"></span>)</span> { <span class="hljs-comment">/* Uses dynamic code */</span> }
}
</code></pre>
<p>When publishing with <code>&lt;PublishAot&gt;true&lt;/PublishAot&gt;</code>, this setup avoids certain analyzer warnings and removes unreachable code paths.</p>
</li>
</ul>
<h2 id="heading-unsafeaccessorattribute-support-for-generic-parameters">UnsafeAccessorAttribute Support for Generic Parameters</h2>
<p><code>UnsafeAccessorAttribute</code>—introduced in .NET 8—allows direct, unsafe access to private type members. In .NET 9, it now supports generic parameters for both CoreCLR and Native AOT scenarios. This expansion enables reflection-free access to generic fields and methods, improving advanced scenarios like performance-sensitive libraries and frameworks.</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">using</span> System.Runtime.CompilerServices;

<span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Class</span>&lt;<span class="hljs-title">T</span>&gt;
{
    <span class="hljs-keyword">private</span> T? _field;
    <span class="hljs-function"><span class="hljs-keyword">private</span> <span class="hljs-keyword">void</span> <span class="hljs-title">M</span>&lt;<span class="hljs-title">U</span>&gt;(<span class="hljs-params">T t, U u</span>)</span> { }
}

<span class="hljs-keyword">class</span> <span class="hljs-title">Accessors</span>&lt;<span class="hljs-title">V</span>&gt;
{
    [<span class="hljs-meta">UnsafeAccessor(UnsafeAccessorKind.Field, Name = <span class="hljs-meta-string">"_field"</span>)</span>]
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">extern</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">ref</span> V <span class="hljs-title">GetSetPrivateField</span>(<span class="hljs-params">Class&lt;V&gt; c</span>)</span>;

    [<span class="hljs-meta">UnsafeAccessor(UnsafeAccessorKind.Method, Name = <span class="hljs-meta-string">"M"</span>)</span>]
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">extern</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">CallM</span>&lt;<span class="hljs-title">W</span>&gt;(<span class="hljs-params">Class&lt;V&gt; c, V v, W w</span>)</span>;
}
</code></pre>
<p>With this feature, code that previously relied on reflection to manipulate generics can now use <code>UnsafeAccessorAttribute</code> for more efficient and predictable access.</p>
<h2 id="heading-garbage-collection-improvements">Garbage Collection Improvements</h2>
<p><strong>Dynamic adaptation to application sizes (DATAS)</strong>, introduced as an opt-in in .NET 8, is now enabled by default. DATAS adjusts memory usage dynamically based on the application’s long-lived data size. This approach helps the GC maintain a heap size proportional to actual memory requirements, improving overall performance and efficiency in real-world workloads.</p>
<p>For more details, see <a target="_blank" href="https://learn.microsoft.com/dotnet/">Dynamic adaptation to application sizes (DATAS)</a>.</p>
<h2 id="heading-control-flow-enforcement-technology-cet">Control-Flow Enforcement Technology (CET)</h2>
<p>CET is now enabled by default on Windows, providing hardware-enforced protection against return-oriented programming (ROP) exploits. CET improves application security by enforcing safer control-flow transitions. Although it may introduce a small performance overhead, CET can be disabled if necessary. This marks a significant step in hardening .NET applications against low-level attacks.</p>
<h2 id="heading-net-install-search-behavior">.NET Install Search Behavior</h2>
<p>.NET 9 adds configuration options for how apps locate and load the .NET runtime. Developers can now more tightly control the search behavior, which is useful for private runtime installations or ensuring a stable, known environment.</p>
<h2 id="heading-performance-improvements-across-the-board">Performance Improvements Across the Board</h2>
<p>The .NET 9 runtime delivers a wide array of performance optimizations. These improvements span JIT compilation, code generation, loop transformations, exception handling, and more. They include:</p>
<ul>
<li><p><strong>Loop Optimizations:</strong><br />Enhanced induction-variable widening, post-indexed addressing on Arm64, strength reduction, and loop counter direction optimizations reduce instruction counts and increase throughput. Common looping patterns—such as iterating over arrays—are now executed more efficiently without any source code changes.</p>
</li>
<li><p><strong>Inlining Improvements:</strong><br />Shared generics that require runtime lookups can now be inlined, reducing overhead and enabling further optimizations. Accesses to thread-local statics on multiple platforms are also more easily inlined, cutting down instruction counts and improving runtime performance.</p>
</li>
<li><p><strong>PGO Enhancements:</strong><br />Dynamic profile-guided optimization (PGO), enabled by default since .NET 8, now drives more decisions, including optimizing type checks and casts based on observed runtime behavior. This leads to faster code paths for the common cases your application actually encounters.</p>
</li>
<li><p><strong>Arm64 and SIMD Codegen:</strong><br />Arm64 benefits from vectorization in <code>.NET libraries</code>, multi-register load/store instructions, post-indexed addressing, and store-pair instructions. AVX10v1 support and Arm SVE experimental support introduce new hardware acceleration paths, allowing .NET to leverage cutting-edge CPU instruction sets for even greater speed-ups.</p>
</li>
<li><p><strong>Faster Exceptions:</strong><br />The exception handling model now mirrors the NativeAOT runtime’s approach, eliminating Windows SEH and Unix emulation. As a result, handling exceptions is up to 2-4 times faster in micro-benchmarks, significantly improving scenarios where exceptions are part of normal execution (for example, certain parsing or cancellation operations).</p>
</li>
<li><p><strong>Code Layout and Reduced Address Exposure:</strong><br />The JIT compiler now rearranges basic blocks more effectively, using profile data to reduce branching. It also tracks addressed-exposed locals more accurately, avoiding unnecessary constraints that limit optimization opportunities.</p>
</li>
<li><p><strong>Object Stack Allocation for Boxes:</strong><br />Situations where value types need to be boxed (for example, passing them as objects) can now be optimized by stack-allocating the box when it doesn’t escape the current method. In some cases, the compiler can even reason about the values and remove the boxes entirely, generating more efficient code and reducing allocations.</p>
</li>
</ul>
<h2 id="heading-summary">Summary</h2>
<p>The .NET 9 runtime brings substantial changes under the hood to deliver faster, more secure, and more efficient applications. Developers benefit from:</p>
<ul>
<li>Greater control over feature sets and trimming, ensuring leaner deployments.</li>
<li>Improved performance through advanced JIT optimizations, vectorization, and better code generation strategies.</li>
<li>Enhanced security via CET and refined exception handling for predictable, safe execution.</li>
<li>New capabilities that enable low-level code manipulation, improved GC behavior, and better CPU-specific optimizations.</li>
</ul>
<p>In the next part, we’ll explore <strong>What’s new in C# 13</strong>, the language updates accompanying this release, and how they integrate with the runtime to provide a more productive and modern development experience.</p>
<p><a target="_blank" href="/3-whats-new-in-csharp-13">Next → What’s New in C# 13</a></p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What's New in .NET 9]]></title><description><![CDATA[.NET 9 introduces a set of features and improvements designed to support modern application development. This release builds on the capabilities introduced in .NET 8, placing a stronger emphasis on cloud-native scenarios, performance optimizations, a...]]></description><link>https://read.satishyadav.com/1-whats-new-in-dotnet-9</link><guid isPermaLink="true">https://read.satishyadav.com/1-whats-new-in-dotnet-9</guid><category><![CDATA[dotnet]]></category><category><![CDATA[dotnet9]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Wed, 18 Dec 2024 09:54:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/s9CC2SKySJM/upload/2d50a3a0ee928b64dcfc86e528cb0de4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>.NET 9 introduces a set of features and improvements designed to support modern application development. This release builds on the capabilities introduced in .NET 8, placing a stronger emphasis on cloud-native scenarios, performance optimizations, and improved developer productivity. As a standard-term support (STS) release, .NET 9 receives 18 months of support, giving organizations sufficient time to adopt and integrate it into their workflows.
</p>
<h2 id="heading-emphasis-on-cloud-native-and-containerized-workloads">Emphasis on Cloud-Native and Containerized Workloads</h2>
<p>Cloud-native architectures and container-based deployments are standard practice for modern applications. .NET 9 aligns with these trends by refining the framework’s capabilities for distributed, scalable systems. This includes adjustments to runtime behavior, library enhancements that streamline serialization and network I/O, and improved integration points for AI and machine learning workloads—all of which are increasingly relevant in orchestrated, cloud-hosted environments.</p>
<p>For example:</p>
<ul>
<li><p><strong>Runtime Adjustments for Cloud Scale:</strong> Changes in garbage collection and performance heuristics are designed to better handle highly variable workloads common in cloud scenarios. Dynamic memory management improvements help applications adapt to fluctuating demand without manual intervention.</p>
</li>
<li><p><strong>Optimized Communication and Serialization:</strong> Enhancements in <strong>System.Text.Json</strong>, such as support for nullable reference type annotations, exporting JSON schemas from types, and new options for customizing JSON indentation, reduce overhead in microservices that frequently communicate using JSON-based payloads.</p>
</li>
</ul>
<h2 id="heading-performance-improvements-from-top-to-bottom">Performance Improvements from Top to Bottom</h2>
<p>Performance has been a central priority across multiple layers of .NET 9:</p>
<ul>
<li><p><strong>Runtime-Level Optimizations:</strong> Enhanced code generation, loop optimizations, inlining strategies, and Arm64 vectorization result in more efficient execution paths. The runtime also introduces a new attribute model for feature switches, enabling libraries to toggle functionality at compile or link time, which can shrink binary size and improve startup times.</p>
</li>
<li><p><strong>Library Improvements:</strong> Beyond serialization, improvements to LINQ (like the new <code>CountBy</code> and <code>AggregateBy</code> methods), priority queues (new <code>Remove</code> method for easier priority updates), cryptographic operations (a new <code>CryptographicOperations.HashData</code> and KMAC algorithms), and reflection APIs help developers write faster and more efficient code with fewer allocations and better resource usage.</p>
</li>
<li><p><strong>Refined Tooling and SDK Features:</strong> A more flexible SDK, improved NuGet security audits (now including transitive references by default), and a default-enabled terminal logger enhance the reliability and traceability of builds. The terminal logger provides more concise and usable summaries, making it easier to identify performance regressions or issues in complex projects. Additionally, new MSBuild script analyzers ("build checks") are available to help identify and fix common build-related issues.</p>
</li>
</ul>
<h2 id="heading-ai-and-machine-learning-support">AI and Machine Learning Support</h2>
<p>As applications increasingly integrate AI-driven features, .NET 9 introduces building blocks that simplify the adoption of machine learning and language model capabilities:</p>
<ul>
<li><p><strong>Microsoft.Extensions.AI and Microsoft.Extensions.VectorData:</strong> These packages provide a unified layer of abstractions to interact with AI services, embeddings, vector stores, and middleware. This uniform API surface reduces the complexity of integrating AI features, eliminating the need for custom glue code.</p>
</li>
<li><p><strong>TensorPrimitives and Tensor:</strong> New tensor APIs enable efficient manipulation of multi-dimensional data, crucial for tasks like model inference, image processing, or advanced analytics. These APIs are SIMD-optimized and designed to interoperate efficiently with AI frameworks like ML.NET, TorchSharp, and ONNX Runtime. TensorPrimitives now supports nearly 200 operations (up from 40), generic overloads for different numeric types, and improved performance through SIMD optimizations.</p>
</li>
</ul>
<h2 id="heading-language-updates-and-enhanced-developer-experience">Language Updates and Enhanced Developer Experience</h2>
<p>.NET 9 ships with updates to C# (version 13) and F# (version 9), providing language-level features that simplify coding patterns and modernize idioms:</p>
<ul>
<li><p><strong>C# 13:</strong> Introduces <code>params</code> collections, a new lock type and semantics, a new <code>\e</code> escape sequence, method group natural type improvements, implicit indexer access in object initializers, ref locals in async and iterator methods, and <code>allows ref struct</code> constraints for generics, along with partial properties and indexers.</p>
</li>
<li><p><strong>F# 9:</strong> Adds nullable reference types, discriminated union <code>.Is*</code> properties, partial active patterns returning bool, improved tooling support, and other performance and productivity enhancements.</p>
</li>
</ul>
<p>These language updates help developers write safer, more maintainable code and take advantage of modern constructs that improve both productivity and safety.</p>
<h2 id="heading-broad-ecosystem-enhancements">Broad Ecosystem Enhancements</h2>
<p>ASP.NET Core 9.0 gains optimizations like handling static files more efficiently at build and publish time, Blazor enhancements (hybrid and web app templates, reconnection improvements), API OpenAPI generation, enhanced native AOT support, and security improvements. ML.NET 4.0 brings improved configuration options, ONNX model loading from streams, tokenizer capabilities, and TorchSharp integration for new model families. .NET MAUI focuses on performance, reliability, Native AOT and trimming enhancements, a new TitleBar control on Windows, and a HybridWebView.</p>
<p>EF Core 9 refines Azure Cosmos DB support, steps towards AOT compilation, and pre-compiled queries, while the libraries add LINQ improvements, JSON schema generation, and reflect new methods like <code>CountBy</code> and <code>AggregateBy</code>.</p>
<p>Windows Presentation Foundation (WPF) and Windows Forms also see enhancements, with modern theming, improved ligature support in fonts, no more <code>BinaryFormatter</code>, and rendering improvements for code generation and debugging scenarios.</p>
<h2 id="heading-engaging-with-the-community-and-looking-ahead">Engaging with the Community and Looking Ahead</h2>
<p>The .NET team actively posts .NET 9 preview updates and discussions on GitHub, allowing developers to stay informed, ask questions, and provide direct feedback. This open dialogue helps refine features before general availability.</p>
<p><strong>To Learn More:</strong>  </p>
<ul>
<li><a target="_blank" href="https://aka.ms/dotnet-download">Download .NET 9</a> to begin experimenting with the latest improvements.  </li>
<li>Explore the official documentation for detailed guidance on new APIs, runtime settings, and advanced scenarios.  </li>
<li>Check out .NET 9 GitHub Discussions for ongoing previews, Q&amp;A, and community feedback.</li>
</ul>
<p><a target="_blank" href="/2-whats-new-in-dotnet-9-runtime">Next → What’s New in the .NET 9 Runtime</a>  </p>
<p><strong>Subscribe to the blog</strong> to stay updated on the latest .NET developments!</p>
<p><strong>Follow on social media:</strong></p>
<ul>
<li><a target="_blank" href="https://twitter.com/punskaari">Twitter/X: @punskaari</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/iSatishYadav">LinkedIn: @iSatishYadav</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What’s new in .NET 8]]></title><description><![CDATA[The release of .NET 8 heralds a new era in software development, marking a significant milestone in the evolution of the .NET ecosystem. This iteration introduces a plethora of groundbreaking technical enhancements designed to amplify the capabilitie...]]></description><link>https://read.satishyadav.com/whats-new-in-dotnet-8</link><guid isPermaLink="true">https://read.satishyadav.com/whats-new-in-dotnet-8</guid><category><![CDATA[dotnet]]></category><category><![CDATA[#dotnet8]]></category><category><![CDATA[dotnetcore]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Thu, 16 Nov 2023 18:59:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1700159890839/5cc581b7-7224-4784-9112-f35c0c9b4fd3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The release of .NET 8 heralds a new era in software development, marking a significant milestone in the evolution of the .NET ecosystem. This iteration introduces a plethora of groundbreaking technical enhancements designed to amplify the capabilities of developers and the performance of applications across various domains.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160445142/1aaf3c33-72e4-457b-b1ae-0b0b8c2765da.png" alt /></p>
<h2 id="heading-unprecedented-performance-optimizations">Unprecedented Performance Optimizations</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160464441/522c2013-1841-40d3-9f27-2d03b17df2ca.png" alt /></p>
<p>The latest iteration of .NET brings forth several performance optimizations that significantly augment application efficiency and responsiveness:</p>
<ul>
<li><p><strong>Dynamic Profile-Guided Optimization (PGO):</strong> Enabling up to a 20% improvement in application performance through real-world usage-based code optimization.</p>
</li>
<li><p><strong>AVX-512 Support:</strong> Empowering parallel operations on 512-bit data vectors, ensuring enhanced data processing capabilities and accelerated computational throughput.</p>
</li>
<li><p><strong>UTF-8 Formattable and Parsable Interface:</strong> Direct UTF-8 formatting and parsing capabilities sans transcoding overhead, fortifying application efficiency and responsiveness.</p>
</li>
</ul>
<h2 id="heading-net-aspire-redefining-cloud-native-development">.NET Aspire: Redefining Cloud-Native Development</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160140211/0887569c-71a3-46ee-9be4-ebbc34b5099f.png" alt /></p>
<p>.NET Aspire represents a curated collection of components tailored explicitly for cloud-native application development. With an emphasis on resilience, observability, and simplified configuration, it provides:</p>
<ul>
<li><p><strong>Curated Components:</strong> Equipped with enhanced telemetry, resilience, configuration, and health check capabilities by default.</p>
</li>
<li><p><strong>Streamlined Local Developer Experience:</strong> Simplified acquisition and configuration of essential dependencies for cloud-native applications, facilitating a seamless development journey.</p>
</li>
</ul>
<h2 id="heading-augmented-container-capabilities-in-net-8">Augmented Container Capabilities in .NET 8</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160499430/50d70f51-3865-4565-b147-876c6c7dd923.png" alt /></p>
<p>Containerized application deployment is further fortified in .NET 8, ensuring:</p>
<ul>
<li><p><strong>Enhanced Container Security:</strong> Incorporation of non-root users within .NET images, bolstering container security measures.</p>
</li>
<li><p><strong>Compact Image Sizes:</strong> Faster deployment facilitated by minimized .NET base image sizes, optimizing resource utilization.</p>
</li>
</ul>
<h2 id="heading-native-aot-facilitating-compute-efficiency">Native AoT - Facilitating Compute Efficiency</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160528337/f0636464-0805-4e21-a068-509df93a4311.png" alt /></p>
<p>Compile .NET applications into native code to minimize memory footprint and expedite app initialization:</p>
<ul>
<li><strong>Compiled Native Code:</strong> Immediate app startup without JIT compilation overhead, facilitating operation in restricted environments.</li>
</ul>
<h2 id="heading-integrating-artificial-intelligence-with-net">Integrating Artificial Intelligence with .NET</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160551209/53cf5167-1966-43ea-a479-12697e34cd81.png" alt /></p>
<p>Harness the power of generative AI and large language models, seamlessly integrated into .NET 8:</p>
<ul>
<li><p><strong>Generative AI Integration:</strong> Simplified AI integration with first-class out-of-the-box AI features within the .NET SDK.</p>
</li>
<li><p><strong>System.Numerics Library Enhancements:</strong> Enhanced compatibility with Generative AI workloads, integrating Tensor Primitives.</p>
</li>
</ul>
<h2 id="heading-advanced-web-application-development-with-blazor">Advanced Web Application Development with Blazor</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160569053/4f4e43b8-7670-437d-b8bb-57416d2ade58.png" alt /></p>
<p>Blazor in .NET 8 introduces innovative features for comprehensive web UI development:</p>
<ul>
<li><p><strong>Blazor Server and Blazor WebAssembly Integration:</strong> Full-stack web UI capabilities merging server and client-side functionalities.</p>
</li>
<li><p><strong>Robust Authentication and Authorization:</strong> Full support for Blazor-based Identity UI, elevating security measures.</p>
</li>
</ul>
<h2 id="heading-net-maui-unifying-cross-platform-development">.NET MAUI - Unifying Cross-Platform Development</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1700160582918/ba1cbb56-34c0-4f70-bddd-bae118ec9ac4.png" alt /></p>
<p>.NET MAUI revolutionizes cross-platform app development, unifying project systems across multiple platforms:</p>
<ul>
<li><p><strong>Unified Project System:</strong> Develop WinUI, Mac Catalyst, iOS, and Android applications from a single codebase.</p>
</li>
<li><p><strong>Quality Improvements:</strong> Enhanced performance, controls, UI elements, and platform-specific behaviors.</p>
</li>
</ul>
<h2 id="heading-c-12-features-amplifying-developer-productivity">C# 12 Features - Amplifying Developer Productivity</h2>
<p>The introduction of C# 12 brings forth a range of productivity enhancements:</p>
<ul>
<li><p><strong>Primary Constructors:</strong> Streamlined class initialization, minimizing boilerplate code.</p>
</li>
<li><p><strong>Concise Collection Types:</strong> Simplified array and span creation, augmenting code readability.</p>
</li>
<li><p><strong>Lambda Expression Parameter Defaults:</strong> Improved handling of optional arguments within lambda expressions.</p>
</li>
</ul>
<h2 id="heading-broader-net-8-support-across-development-tools">Broader .NET 8 Support Across Development Tools</h2>
<p>Visual Studio 2022 17.8 and Visual Studio Code's C# Dev Kit offer extended support for .NET 8, empowering developers with advanced tooling capabilities across diverse development environments.</p>
<h2 id="heading-additional-new-features">Additional new features</h2>
<ul>
<li><p><a target="_blank" href="http://ASP.NET"><strong>ASP.NET</strong></a> <strong>Core</strong>: Streamlines identity for single-page applications (SPA) and Blazor providing cookie-based authentication, pre-built APIs, token support, and a new identity UI. Enhances minimal APIs with form-binding, antiforgery support to protect against cross-site request forgery (XSRF/CSRF), and asParameters support for parameter-binding with Open API definitions.</p>
</li>
<li><p><a target="_blank" href="http://ASP.NET"><strong>ASP.NET</strong></a> <strong>Core Tooling</strong>: Route syntax highlighting, auto-completion, and analyzers to help you create Web APIs.</p>
</li>
<li><p><strong>Entity Framework Core</strong>: Provides new “complex types” as value objects, primitive collections, and SQL Server support for hierarchical data.</p>
</li>
<li><p><strong>NuGet</strong>: Helps you audit your NuGet packages in projects and solutions for any known security vulnerabilities.</p>
</li>
<li><p><strong>.NET Runtime</strong>: Brings a new AOT compilation mode for WebAssembly (WASM) and Android.</p>
</li>
<li><p><strong>.NET SDK</strong>: Revitalizes terminal build output and production-ready defaults.</p>
</li>
<li><p><strong>WPF</strong>: Supports OpenFolderDialog and Enabled HW Acceleration in RDP.</p>
</li>
<li><p><strong>ARM64</strong>: Significant feature enhancements and improved code quality for ARM64 platforms through collaboration with ARM engineers.</p>
</li>
<li><p><strong>Debugging</strong>: Displays debug summaries and provides simplified debug proxies for commonly used .NET types.</p>
</li>
<li><p><strong>System.Text.Json</strong>: Helps populate read-only members, customizes unmapped member handling, and improves Native AOT support.</p>
</li>
<li><p><strong>.NET Community Toolkit</strong>: Accelerates building .NET libraries and applications while ensuring they are trim and AOT compatible (including the MVVM source generators!)</p>
</li>
<li><p><strong>Azure</strong>: Supports .NET 8 with Azure’s PaaS services like App Service for Windows and Linux, Static Web Apps, Azure Functions, and Azure Container Apps.</p>
</li>
<li><p><strong>F# 8</strong>: Includes significant language changes, new diagnostics, improvements in usability, and performance enhancements in project compilation, as well as upgrades to the FSharp.Core standard library.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>.NET 8 stands as a testament to continuous innovation, fostering a robust ecosystem for developers to craft high-performance, resilient, and scalable applications across diverse domains. It represents a leap forward in the realm of software development, revolutionizing the way applications are built and optimized.</p>
<p>Embrace the future of development with .NET 8, explore its technical depths, and join my journey at my blog here at https://blog.satishyadav.com</p>
<h2 id="heading-getting-started">Getting started</h2>
<ul>
<li><p><a target="_blank" href="https://dotnet.microsoft.com/download/dotnet/8.0">Download .NET 8</a></p>
</li>
<li><p><a target="_blank" href="https://dotnet.microsoft.com/platform/upgrade-assistant">Upgrade your old apps to .NET 8</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Microsoft finally announces the official C# Certification]]></title><description><![CDATA[Microsoft has announced the official C# certification Foundational C# with Microsoft in partnership with FreeCodeCamp — a popular online learning platform.
This course offers a comprehensive introduction to C# programming, covering its core concepts,...]]></description><link>https://read.satishyadav.com/microsoft-finally-announces-the-official-c-sharp-certification</link><guid isPermaLink="true">https://read.satishyadav.com/microsoft-finally-announces-the-official-c-sharp-certification</guid><category><![CDATA[C#]]></category><category><![CDATA[Certification]]></category><category><![CDATA[Microsoft]]></category><category><![CDATA[freeCodeCamp.org]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Tue, 19 Sep 2023 10:22:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1695112357888/6bc205af-e001-4622-ac7a-3e76a905d678.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Microsoft has <a target="_blank" href="https://shawt.io/r/sZx">announced</a> the official C# certification <a target="_blank" href="https://shawt.io/r/sZw">Foundational C# with Microsoft</a> in partnership with <em>FreeCodeCamp</em> — a popular online learning platform.</p>
<p>This course offers a comprehensive introduction to C# programming, covering its core concepts, syntax, and practical application in software development.</p>
<blockquote>
<p>Through hands-on exercises and projects, you will learn the fundamentals of C#, including variables, data types, control structures, and object-oriented programming principles.</p>
</blockquote>
<p>By the end of this course, you will have gained the practical skills and knowledge needed to confidently leverage C# for building applications.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695117460631/f178d0d9-a0e9-43de-a187-5e2ef72a4e9e.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-is-it-worth-learning-c-today">Is it worth learning C# today?</h3>
<p>Well, yes of course! C# continues to be among the World’s top 5 Programming Languages, after Python, C, C++, and Java. Surpassing even JavaScript, Go, and Rust. C# is used not only by Large Enterprises but also in Game Development, Web Development, Cross-Platform Mobile App development and many more.</p>
<p>The certification is completely free.</p>
<p>This new certification’s content is hosted on Microsoft Learn — Microsoft’s learning Platform where hundreds of Microsoft Training and Learning materials are available free of cost.</p>
<p>The official C# certification was missing for a long time as earlier official certification <a target="_blank" href="https://shawt.io/r/sZv"><strong>Exam 70-483: Programming in C#</strong></a> had retired in 2021.</p>
<h3 id="heading-is-it-for-me">Is it for me?</h3>
<p>The course has something for everybody, whether you're a seasoned developer working with C# for decades or a newcomer who is just trying their hands dirty with C#. I too, have completed the Course and got the Certificate and I must say it’s comprehensive. It doesn’t require prior C# knowledge but assumes you have some programming sense.</p>
<p>One small weirdness I have observed is, it requires you to go back and forth between freeCodeCamp and Microsoft Learn to unlock trophies and complete tasks. Everything else is seamless, structured, and to the point.</p>
<p>Here are the complete official steps to complete the certification:</p>
<h3 id="heading-steps-to-earn-your-certificate">Steps to earn your certificate</h3>
<ol>
<li><p>Go to the <a target="_blank" href="https://shawt.io/r/sZw">Foundational C# Certification path on freeCodeCamp</a>. Here you’ll find the training content under <strong>Courses</strong>. Press <strong>Expand course</strong> to find all the modules within each course.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695117859647/9ed81dd6-41b8-4657-82b6-51163112b0c2.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Click on each module in the course to find the link to the training content for that module.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695117899059/8e5e735e-808f-4bdf-aca7-eef882e194cb.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Complete the training content on Microsoft Learn. (Note: If you have previously completed the training content, you do not need to redo it)</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695117945415/3de15821-a42b-46c5-bfb4-2e5f94132b94.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Once you are done, complete the comprehension check question on freeCodeCamp.</p>
</li>
<li><p>At the end of each course, you will receive a Trophy on Microsoft Learn. Each step on freeCodeCamp will show instructions for how you can claim and submit these Trophies.</p>
</li>
<li><p>Once you complete all the training, take the exam.</p>
</li>
<li><p>Earn your certification!</p>
</li>
</ol>
<p>I have gone through the course and completed the certification.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695117775984/109df4c9-3590-4d77-9993-54b64f2711cb.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Overall this Certification is worth it and is recommended for all.</p>
<p>Have you tried this new C# certification? What are your thoughts on this? Comment below.</p>
]]></content:encoded></item><item><title><![CDATA[5 things I wish I knew before writing 1 Million lines of code]]></title><description><![CDATA[Developers spend much more time reading the code than writing it. So, after optimizing code for time and space complexity — optimize it for reading complexity. There’s even a term for that — Cyclomatic Complexity.
After having written more than 1 mil...]]></description><link>https://read.satishyadav.com/5-things-i-wish-i-knew-before-writing-1-million-lines-of-code</link><guid isPermaLink="true">https://read.satishyadav.com/5-things-i-wish-i-knew-before-writing-1-million-lines-of-code</guid><category><![CDATA[readability]]></category><category><![CDATA[Enterprise Software Development]]></category><category><![CDATA[software development]]></category><category><![CDATA[coding]]></category><category><![CDATA[development]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Sat, 24 Jun 2023 16:54:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Im_cQ6hQo10/upload/7a288b0bb3190e3d7b337d6ba564be68.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Developers spend much more time reading the code than writing it. So, after optimizing code for time and space complexity — optimize it for reading complexity. There’s even a term for that — Cyclomatic Complexity.</p>
<p>After having written more than 1 million lines of code and having read much more awful lot, here are the top 5 things I wish I knew sooner to write more readable code.</p>
<h3 id="heading-1-your-code-will-be-read-more-times-than-you-think">#1. Your code will be read more times than you think.</h3>
<p>A common misconception among upcoming and new developers is — Software Development is about writing the O(n) complexity code of binary tree inversion. And I hate to break it to you — it’s not.</p>
<p>A lot of time it’s about, adding a new feature or fixing a bug in an existing code base with its own coding conventions, naming conventions, design, and architecture. So reading and understanding the existing code becomes one of the most important parts of the job.</p>
<blockquote>
<p>Great developers spend a lot of time reading other people’s code.</p>
</blockquote>
<h3 id="heading-2-readable-code-gt-smart-code">#2. Readable code &gt; Smart Code</h3>
<p>In almost all programming languages and frameworks, there are numerous ways of doing the same thing. The smarter and one-liner way may feel good to write at the moment, but often it’s not good for the next reader — which can be YOU six months down the line.</p>
<p>So,</p>
<blockquote>
<p>If there is a little more verbose but more readable way to do it — do it and your future self will thank you later.</p>
</blockquote>
<h3 id="heading-3-document-the-why-instead-of-what">#3. Document the “why” instead of “what”.</h3>
<p>Usually, I’m against documentation. Because</p>
<blockquote>
<p>The code is literally the instructions written to build something.</p>
</blockquote>
<p>The only parts that need documentation are the “why”. Why we’ve written this piece of code this way?</p>
<p>If you don't understand the "what"? Maybe you shouldn't be the one changing it.</p>
<h3 id="heading-4-describe-everything-your-functionmethod-does-in-the-name">#4. Describe everything your <code>function</code>/<code>method</code> does in the name.</h3>
<blockquote>
<p>There are only 2 difficult things in Computer Science — Cache Invalidation and Naming</p>
</blockquote>
<p>Just by reading the name of the function, its intent should be clear.</p>
<p>“But then large functions would have way big names” — that’s the point. Your function should do only 1 or a few things and do it properly.</p>
<blockquote>
<p>Refactor the <code>function</code>/<code>method</code> if it’s job can’t be described in the name.</p>
</blockquote>
<h3 id="heading-5-deadline-is-a-silly-excuse-for-writing-bad-code">#5. “Deadline” is a silly excuse for writing bad code.</h3>
<p>“There’s no time to write good code” is not a good enough excuse for writing bad code.</p>
<blockquote>
<p>Checking for the readability of your code is like flushing the toilet — it’s part of the ceremony. You do it no matter how late you are for anything else.</p>
</blockquote>
<p>So next time you write code, think about your future self, what would you answer to that person? Don’t bring shame to yourself. Write readable code.</p>
<p>Happy Coding!</p>
]]></content:encoded></item><item><title><![CDATA[Managing Technical Debt with NDepend!]]></title><description><![CDATA[What the hell is Technical Debt?
You are working on a cool new project, and want to implement the amazing new design pattern that you learned about a few days ago. All is well. Until your boss comes to your desk and tells you the release is preponed ...]]></description><link>https://read.satishyadav.com/managing-technical-debt-with-ndepend</link><guid isPermaLink="true">https://read.satishyadav.com/managing-technical-debt-with-ndepend</guid><category><![CDATA[technical-debt]]></category><category><![CDATA[Software Engineering]]></category><category><![CDATA[software development]]></category><category><![CDATA[ndepend]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Sat, 03 Sep 2022 09:21:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782653949/a7e795c8-b422-443b-b4bc-def3183cb882.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-the-hell-is-technical-debt">What the hell is Technical Debt?</h2>
<p>You are working on a cool new project, and want to implement the amazing new design pattern that you learned about a few days ago. All is well. Until your boss comes to your desk and tells you the release is preponed (is that even a word?) by 10 days. WTH man! Now whatever plans you had to make the code readable, testable, SOLID - goes for a toss, and you stuff the code to make up for the early release.</p>
<blockquote>
<p>So you bought some time by writing "not-so-good code" to meet the deadline.</p>
</blockquote>
<p>Let this sink in for a moment.</p>
<p>You know that the code that you had written needs to be refactored, but you don't have the bandwidth (not the internet one) to do so, so you live with this "bad code" - aka <code>technical debt</code>.</p>
<p>Well, debts inherently aren't bad, you take debts all the time - Credit Cards, Car loans, House loans. But you need to pay the interest, and as long you re-pay, it's well and good. The same goes for the technical debt. It's a trade-off between Product Delivery and impeccable code.</p>
<h2 id="heading-how-do-i-know-that-i-have-a-technical-debt">How do I know that I have a Technical Debt</h2>
<p>Some time ago, I did not have any single tool which can give a clear idea of what kind of and how much technical debt I had.</p>
<p>I was looking at different metrics e.g., Code Duplication, Cyclomatic Complexity, Test Coverage, Dependency and Coupling, and more to get an idea.</p>
<p>Then I stumbled upon <a target="_blank" href="https://www.ndepend.com/?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post"><code>NDepend</code></a>.</p>
<p>NDepende can scan your code base and tell you how much technical debt you have in a single actionable dashboard.</p>
<h2 id="heading-what-is-ndepend">What is NDepend</h2>
<p>NDepend can do much more than that, e.g.,</p>
<ul>
<li><p>Code Rule and Code Query over LINQ (CQLinq)</p>
</li>
<li><p>Powerful Dependency Graph and Matrix</p>
</li>
<li><p>Smart Technical Debt Estimation</p>
</li>
<li><p>Quality Gates</p>
</li>
<li><p>In-Depth Issues Management</p>
</li>
<li><p>Trend Monitoring</p>
</li>
<li><p>Harness Test Coverage Data</p>
</li>
<li><p>Code Quality and Code Metrics</p>
</li>
<li><p>Detect Dependency Cycles</p>
</li>
<li><p>Code Diff since Baseline</p>
</li>
<li><p>Enforce Immutability and Purity</p>
</li>
<li><p>Complexity and Diagrams</p>
</li>
<li><p>Continuous Integration Reporting</p>
</li>
<li><p>Warnings on Build</p>
</li>
<li><p>Process Health</p>
</li>
</ul>
<p>and more.</p>
<p>They consider themselves, <em>The "Swiss Army Knife" for .NET Developers, Architects and Teams</em></p>
<p>Visit their <a target="_blank" href="https://www.ndepend.com/?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post">official site</a> to know more.</p>
<p><em>The NDepend team was generous to give me a copy of their license to try out the product</em></p>
<p>If you're new to NDepend or want to know how to install and get started, folks at NDepend have written wonderful step-by-step documentation.</p>
<blockquote>
<p>The thing I like about NDepend is, it gives me a visual dashboard that is actionable. And all the data it provides, has LINQ queries to support that and accommodate custom rules as well.</p>
</blockquote>
<h2 id="heading-how-to-find-out-technical-debt">How to find out Technical Debt</h2>
<p>For this post, I've taken the <a target="_blank" href="https://github.com/jasontaylordev/CleanArchitecture?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post">Clean Architecture repo</a> from <a target="_blank" href="https://github.com/jasontaylordev?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post">Jason Taylor</a>. If you don't know Jason, he's the Clean Architecture guy, a great developer, trainer, architect, and more.</p>
<p>Once you clone the repo in Visual Studio, here's what the Project structure looks like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782639432/0ac6c449-c194-48e8-9ae6-9dbeb46587c4.png" alt="project-structure" /></p>
<p>An Angular SPA with Application Layer, Domain Layer, and Infrastructure Layer - the Clean Architecture.</p>
<p>Attached is the NDepend to this solution:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782640706/e2cf51f2-8e34-4e51-903a-779a307993c6.png" alt="attach-to-solution" /></p>
<p>NDepend will detect the projects and exclude test projects. Click on Analyze X NET Assemblies.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782643013/6153ff9b-c0b2-44dc-8ff0-4224b28a0955.png" alt="pre-run" /></p>
<p>Give it some time to finish.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782645132/62a216d4-5bc1-45b2-baa3-7fbeff79086a.png" alt="finished" /></p>
<p>Click on the View NDepend Dashboard.</p>
<h2 id="heading-dashboard">Dashboard</h2>
<p>The dashboard gives you a plethora of information about the Project code quality, lines of code, issues, and comments, but we're interested in technical debt.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782646918/bd7443bc-4ff9-4f1d-a6cc-ce5263640d08.png" alt="dashboard" /></p>
<p>In this case, you can see there is a 5.56% of technical debt. Well done, Jason!</p>
<blockquote>
<p>The Smart Technical Debt feature of NDepend also tells us how many days it would take us to resolve the technical debt.</p>
</blockquote>
<p>Amazing, right?</p>
<p>Additionally, it gives us the Rating of the project based on Technical Debt. In our case, <em>B</em>. is Pretty good. And how much effort is required to reach <em>A?</em></p>
<h2 id="heading-exploring-technical-debt">Exploring Technical Debt</h2>
<p>If you click on the rating, NDepend will show you the hot spots of the code where most of the debt is.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782648818/c6207d55-93a0-41cb-92ae-cdcbbd2266aa.png" alt="hotspot" /></p>
<p>Clicking on the Debt % gives the list of all the issue</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782650245/5a7780be-de14-46f0-b897-9ee4d137bf69.png" alt="rules" /></p>
<p>Click on a specific rule to find out the details and what all code has contributed to this technical debt.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782652576/3c045fd5-b41a-4ad9-9f54-498bc339ac66.png" alt="rule-detail" /></p>
<p>In the above example, our code base has violated the following rule:</p>
<p>• Rule Name: Avoid namespaces dependency cycles • Rule Id: ND1401 • Rule Explicit Id: AvoidNamespacesDependencyCycles</p>
<p>• Rule Description:</p>
<p>This rule lists all application namespace dependency cycles. Each row shows a different cycle, indexed with one of the namespaces entangled in the cycle.</p>
<p>Read our white books relative to partitioning code, to know more about namespaces dependency cycles, and why avoiding them is a simple yet efficient solution to clean the architecture of a code base. <a target="_blank" href="https://www.ndepend.com/docs/white-books?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post">https://www.ndepend.com/docs/white-books</a></p>
<p>• How to Fix Issues of this Rule:</p>
<p>Removing the first pairs of mutually dependent namespaces will eliminate most namespaces dependency cycles. This is why it is recommended to focus first on matches of the default rule Avoid namespaces mutually dependent before attempting to fix issues of the present rule.</p>
<p>Once all mutually dependent namespace occurrences are solved, remaining cycles matched by the present rule necessarily involve 3 or more namespaces like in: A is using B is using C is using A.</p>
<p>To browse a cycle on the dependency graph or the dependency matrix, right-click a cycle cell in the result of the present rule and export the matched namespaces to the dependency graph or matrix. This is illustrated here: <a target="_blank" href="https://www.ndepend.com/docs/visual-studio-dependency-graph#Entangled?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post">https://www.ndepend.com/docs/visual-studio-dependency-graph#Entangled</a></p>
<p>With such a cycle graph visualized you can determine which dependencies should be discarded to break the cycle. To do so, you need to identify which namespace should be at low level and which one should be at high-level.</p>
<p>In the A is using B is using C is using A cycle example, if A should be at a low level then C should be at a higher level than A. As a consequence C shouldn't use A and this dependency should be removed. To remove a dependency you can refer to patterns described in the HowToFix section of the rule Avoid namespaces mutually dependent.</p>
<p>Notice that the dependency matrix can also help to visualize and breaking cycles. In the matrix, cycles are represented with red squares and black cells. To easily browse dependency cycles, the dependency matrix comes with an option: Display Direct and Indirect Dependencies. See related documentation here: [https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Cycle https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Mutual](https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Cycle https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Mutual?utm_source=blog.satishyadav.com&amp;utm_medium=technical_debt_blog_post)</p>
<p>The estimated Debt, which means the effort to fix such issue, doesn't depend on the cycle length. First, because fixing the rule Avoid namespaces mutually dependent will fix most cycles reported here, and second because even a long cycle can be broken by removing a single or a few dependencies.</p>
<p>• How to Suppress an Issue of this Rule:</p>
<p>In the source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1401:AvoidNamespacesDependencyCycles", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without the CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.</p>
<p>Pretty detailed, right?</p>
<h2 id="heading-next-steps">Next steps</h2>
<p>Now you have a basic understanding of what Technical Debt is and how NDepend can take you into your journey of becoming Technical-Debt-free (if that's a thing).</p>
<p>Visit the NDepend site to learn more.</p>
<p>Here's the repo used in this post, give this a star:</p>
<p><a target="_blank" href="https://github.com/iSatishYadav/CleanArchitectureCodeBase">https://github.com/iSatishYadav/CleanArchitectureCodeBase</a></p>
<p>Originally posted at:</p>
<p><a target="_blank" href="https://blog.satishyadav.com/managing-technical-debt-with-ndepend">https://blog.satishyadav.com/managing-technical-debt-with-ndepend</a></p>
<p>Happy Coding!</p>
]]></content:encoded></item><item><title><![CDATA[Automate Windows Software and Apps' installation!]]></title><description><![CDATA[Why?
If you've installed Windows enough times, you already know the pain of installing all your Software and Apps again and again. If you haven't, let me save you the pain and show you how to:

Automate the installation of Windows Software and Apps

...]]></description><link>https://read.satishyadav.com/automate-windows-software-and-apps-installation</link><guid isPermaLink="true">https://read.satishyadav.com/automate-windows-software-and-apps-installation</guid><category><![CDATA[Chocolatey]]></category><category><![CDATA[winget]]></category><category><![CDATA[Windows]]></category><category><![CDATA[automation]]></category><category><![CDATA[Installation]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Fri, 12 Aug 2022 13:13:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782658998/6b34187e-7aae-4a26-88f0-1cf0e54ad58e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why">Why?</h2>
<p>If you've installed Windows enough times, you already know the pain of installing all your Software and Apps again and again. If you haven't, let me save you the pain and show you how to:</p>
<blockquote>
<p>Automate the installation of Windows Software and Apps</p>
</blockquote>
<h2 id="heading-package-manager-ftw">Package Manager FTW!</h2>
<p>What we need here is something called Package Manager, which we can give some commands and it would install the software from the command line itself.</p>
<p>Why command line — so that we can repeat the process.</p>
<p><s>Windows doesn't have an official Package Manager yet</s>, but <a target="_blank" href="https://chocolatey.org/">Chocolatey</a> is your safest bet.</p>
<blockquote>
<p>Windows has gotten <code>winget</code> but it's relatively new and community support/references are much better for Chocolatey.</p>
</blockquote>
<p>So here's what we're going to do, we need to search and list down all the software that we typically install and save that command at a place where we can refer it later. It can be on any of Drives (Google Drive, OneDrive) or if you're a developer or power user (whatever that is) - on a Git repo. I don't care, as long as you have access to it when the time comes.</p>
<p>So let's get to it.</p>
<h2 id="heading-1-install-chocolatey-itself">1. Install Chocolatey itself</h2>
<p>From an Admin terminal (PowerShell or Windows Terminal)</p>
<pre><code class="lang-powershell"><span class="hljs-built_in">Set-ExecutionPolicy</span> Bypass <span class="hljs-literal">-Scope</span> <span class="hljs-keyword">Process</span> <span class="hljs-literal">-Force</span>; <span class="hljs-built_in">iex</span> ((<span class="hljs-built_in">New-Object</span> System.Net.WebClient).DownloadString(<span class="hljs-string">'https://community.chocolatey.org/install.ps1'</span>))
</code></pre>
<h2 id="heading-2-install-packages">2. Install packages</h2>
<p>If you are already familiar with the package names of individual Software or the App, you can skip this otherwise you can search</p>
<h3 id="heading-21-search">2.1 Search</h3>
<p>Let's say I don't know what is the name of the Node.js package. I can search:</p>
<h4 id="heading-211-search-from-cli">2.1.1 Search from CLI</h4>
<pre><code class="lang-powershell">choco search nodejs
</code></pre>
<p>It should return results something like that:</p>
<pre><code class="lang-powershell">nodejs <span class="hljs-number">16.11</span>.<span class="hljs-number">0</span> [<span class="hljs-type">Approved</span>]
nodejs.commandline <span class="hljs-number">6.11</span>.<span class="hljs-number">0</span> [<span class="hljs-type">Approved</span>]
nodejs.install <span class="hljs-number">16.11</span>.<span class="hljs-number">0</span> [<span class="hljs-type">Approved</span>]
nodejs<span class="hljs-literal">-lts</span> <span class="hljs-number">14.18</span>.<span class="hljs-number">0</span> [<span class="hljs-type">Approved</span>]
...
<span class="hljs-number">30</span> packages found.
</code></pre>
<blockquote>
<p>Homework: What does <code>[Approved]</code> mean?</p>
</blockquote>
<h4 id="heading-211-seach-from-chocolatey-site">2.1.1 Seach from Chocolatey site:</h4>
<p>Visit https://community.chocolatey.org/packages to find all the supported packages. You can find all sorts of amazing Software and Apps including day-to-day software like Chrome, Zoom, and iTunes - to Enterprise Developer Tools like Visual Studio, Python, Azure and AWS CLI - and whatnot.</p>
<h3 id="heading-22-install">2.2 Install</h3>
<p>This is how you install a package. From an Admin terminal:</p>
<ul>
<li>Node.js</li>
</ul>
<pre><code class="lang-powershell">choco install nodejs<span class="hljs-literal">-lts</span>
</code></pre>
<ul>
<li>VS Code</li>
</ul>
<pre><code class="lang-powershell">choco install vscode
</code></pre>
<p>Now you can save all this in a file and install, but wait "where is the automation you promised? I need my money back." Don't worry, people way smarter than me have thought about this and come up with:</p>
<h2 id="heading-packagesconfig">Packages.config</h2>
<p>There's an official way to list all the packages and install from that file.</p>
<p>Here's what a typical package looks like:</p>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">packages</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">package</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"vscode"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">package</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"nodejs-lts"</span> <span class="hljs-attr">version</span>=<span class="hljs-string">"14.18.0"</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">packages</span>&gt;</span>
</code></pre>
<p>Save this file and in future you can install all the Software and Apps. e.g.</p>
<pre><code class="lang-powershell">choco install <span class="hljs-string">"sample-packages.config"</span>
</code></pre>
<p>Since I already have these packages installed, I got the following message, but you can figure it out from here.</p>
<pre><code class="lang-powershell">Installing from config file:
sample<span class="hljs-literal">-packages</span>.config
By installing, you accept licenses <span class="hljs-keyword">for</span> the packages.
Installing the following packages:
vscode
nodejs<span class="hljs-literal">-lts</span>
vscode v1.<span class="hljs-number">61.0</span> already installed.
 Use -<span class="hljs-literal">-force</span> to reinstall, specify a version to install, or <span class="hljs-keyword">try</span> upgrade.
nodejs<span class="hljs-literal">-lts</span> v14.<span class="hljs-number">18.0</span> already installed.
 Use -<span class="hljs-literal">-force</span> to reinstall, specify a version to install, or <span class="hljs-keyword">try</span> upgrade.

Chocolatey installed <span class="hljs-number">0</span>/<span class="hljs-number">2</span> packages.
 See the log <span class="hljs-keyword">for</span> details (C:\ProgramData\chocolatey\logs\chocolatey.log).
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>That's it! This is how you can automate the installation of your favourite Software and Apps in a repeatable way.</p>
<p>If you liked this, please like and share this post. And visit https://github.com/iSatishYadav/AutomateWindowsSoftwareInstallation and give this repo a star.</p>
<p>Originally posted at:</p>
<p><a target="_blank" href="https://blog.satishyadav.com/automate-new-windows-machine-installation/?utm_source=devto_&amp;utm_medium=blog">https://blog.satishyadav.com/automate-new-windows-machine-installation</a></p>
<p>Happy Hacking!</p>
]]></content:encoded></item><item><title><![CDATA[An “I don’t know what Docker is and at this point I’m too afraid to ask” guide to Docker.]]></title><description><![CDATA[What is Docker?
Docker is an open-source platform for building, deploying, and managing containerized applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.
It is based on the idea...]]></description><link>https://read.satishyadav.com/an-i-dont-know-what-docker-is-and-at-this-point-im-too-afraid-to-ask-guide-to-docker</link><guid isPermaLink="true">https://read.satishyadav.com/an-i-dont-know-what-docker-is-and-at-this-point-im-too-afraid-to-ask-guide-to-docker</guid><category><![CDATA[Docker]]></category><category><![CDATA[Microservices]]></category><category><![CDATA[containers]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Sat, 12 Mar 2022 03:41:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782671477/7265ea4a-0f44-4b4f-a39b-a288efca69a4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-docker">What is Docker?</h2>
<p>Docker is an open-source platform for building, deploying, and managing containerized applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.</p>
<p>It is based on the idea that you can package your code with dependencies into a deployable unit called a "container" that has everything the software needs to run including libraries, system tools, code, and runtime.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782663521/8666c383-d932-41bc-901c-72b2fbaff8d1.png" alt="Docker logo" /></p>
<h2 id="heading-wait-but-whats-a-container">Wait, but what's a "Container"?</h2>
<p>A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.</p>
<p>Containers are made possible by process isolation and virtualization capabilities built into the Linux kernel. As a result, container technology offers all the functionality and benefits of VMs - including application isolation, cost-effective scalability, and disposability - plus important additional advantages:</p>
<ul>
<li><p>Lighter weight</p>
</li>
<li><p>Greater resource efficiency</p>
</li>
<li><p>Improved developer productivity</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782664710/c1fe32e2-5fec-4e20-8a33-4694842e348d.jpeg" alt="Docker" /></p>
<h2 id="heading-thats-too-much-jargon-can-you-give-me-a-simple-analogy">That's too much jargon, can you give me a simple analogy?</h2>
<p>Perhaps a simple analogy can help get a grasp of the core concept of Docker...</p>
<p>Let's go back in time to the 1950s for a moment. There were no word processors, and photocopiers were used everywhere (kind of).</p>
<p>Imagine you're responsible for quickly issuing batches of letters as required, to mail them to customers, using real paper and envelopes, to be delivered physically to each customer's address (there was no email back then).</p>
<p>At some point, you realize the letters are just a composition of a large set of paragraphs, which are picked and arranged as needed, according to the purpose of the letter, so you devise a system to issue letters quickly, expecting to get a hefty raise.</p>
<p>The system is simple:</p>
<p>You begin with a deck of transparent sheets containing one paragraph each.</p>
<p>To issue a set of letters, you pick the sheets with the paragraphs you need, and then you stack and align them so they look and read fine.</p>
<p>Finally, you place the set in the photocopier and press start to produce as many letters as required.</p>
<p>So, simplifying, that's the core idea of Docker.</p>
<p>In Docker, each layer is the resulting set of changes that happen to the filesystem after executing a command, such as installing a program.</p>
<p>So, when you "look" at the filesystem after the layer has been copied, you see all the files, including the layer when the program was installed.</p>
<p>You can think of an image as an auxiliary read-only hard disk ready to be installed in a "computer" where the operating system is already installed.</p>
<p>Similarly, you can think of a container as the "computer" with the image hard disk installed. The container, just like a computer, can be powered on or off.</p>
<h2 id="heading-why-use-docker">Why use Docker</h2>
<p>Using Docker lets you ship software faster, standardize application operations, seamlessly move code, and save money by improving resource utilization.</p>
<p>With Docker, you get a single object that can reliably run anywhere. Docker's straightforward syntax gives you full control. Wide adoption means there's a robust ecosystem of tools and off-the-shelf applications that are ready to use with Docker.</p>
<p>Docker is so popular today that <code>Docker</code> and <code>container</code> are used interchangeably.</p>
<h2 id="heading-but-we-already-have-virtual-machines-why-containers">But, we already have Virtual Machines? Why Containers?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782666771/e59089eb-6798-44ac-b8b6-e848415975bb.png" alt="Container vs VM" /></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Containers</td><td>Virtual Machines</td></tr>
</thead>
<tbody>
<tr>
<td>Containers are an abstraction at the Application layer that packages code and dependencies together.</td><td>Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers.</td></tr>
<tr>
<td>Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space.</td><td>The hypervisor allows multiple VMs to run on a single machine.</td></tr>
<tr>
<td>Containers take up less space than VMs (container images are typically tens of MBs in size), can handle more applications and require fewer VMs and Operating systems.</td><td>Each VM includes a full copy of an operating system, the application, necessary binaries and libraries - taking up tens of GBs.</td></tr>
<tr>
<td>Containers boot up quickly</td><td>VMs can be slow to boot.</td></tr>
</tbody>
</table>
</div><h2 id="heading-docker-tools-and-terms">Docker tools and terms</h2>
<p>Let us familiarize ourselves with Docker terminology.</p>
<h3 id="heading-dockerfile">DockerFile</h3>
<p>Every Docker container starts with a simple text file containing instructions for how to build the Docker container image. DockerFile automates the process of Docker image creation. It’s essentially a list of command-line interface (CLI) instructions that Docker Engine will run to assemble the image.</p>
<h3 id="heading-docker-images">Docker images</h3>
<p>Docker images contain executable application source code as well as all the tools, libraries, and dependencies that the application code needs to run as a container. When you run the Docker image, it becomes one instance (or multiple instances) of the container.</p>
<h3 id="heading-docker-containers">Docker containers</h3>
<p>Docker containers are the live, running instances of Docker images. While Docker images are read-only files, containers are live, ephemeral, executable content. Users can interact with them, and administrators can adjust their settings and conditions using docker commands.</p>
<h3 id="heading-docker-hub">Docker Hub</h3>
<p>Docker Hub is the public repository of Docker images.</p>
<h3 id="heading-docker-daemon">Docker daemon</h3>
<p>Docker daemon is a service running on your operating system, such as Microsoft Windows or Apple MacOS or iOS. This service creates and manages your Docker images for you using the commands from the client, acting as the control centre of your Docker implementation.</p>
<h3 id="heading-docker-registry">Docker registry</h3>
<p>A Docker registry is a scalable open-source storage and distribution system for Docker images. The registry enables you to track image versions in repositories, using tagging for identification. This is accomplished using Git, a version control tool.</p>
<p><img src="https://raw.githubusercontent.com/iSatishYadav/iSatishYadav.github.io/master/images/architecture.svg" alt="Images" /></p>
<h2 id="heading-when-to-use-docker">When to use Docker</h2>
<p>You can use Docker containers as a core building block in creating modern applications and platforms. Docker makes it easy to build and run distributed microservices architecture, deploy your code with standardized continuous integration and delivery pipelines, build highly-scalable data processing systems, and create fully-managed platforms for your developers.</p>
<h3 id="heading-micro-services">Micro-Services</h3>
<p>Build and scale distributed application architectures by taking advantage of standardized code deployments using Docker containers.</p>
<h3 id="heading-continuous-integration-amp-delivery">Continuous Integration &amp; Delivery</h3>
<p>Accelerate application delivery by standardizing environments and removing conflicts between language stacks and versions.</p>
<h2 id="heading-docker-deployment-and-orchestration">Docker deployment and orchestration</h2>
<p>If you're running only a few containers, it's fairly simple to manage your application within Docker Engine, the industry's de facto runtime. But if your deployment comprises thousands of containers and hundreds of services, it's nearly impossible to manage that workflow without the help of these purpose-built tools.</p>
<h3 id="heading-docker-compose">Docker Compose</h3>
<p>If you're building an application out of processes in multiple containers that all reside on the same host, you can use Docker Compose to manage the application's architecture. Docker Compose creates a YAML file that specifies which services are included in the application and can deploy and run containers with a single command. Using Docker Compose, you can also define persistent volumes for storage, specify base nodes, and document and configure service dependencies.</p>
<h3 id="heading-kubernetes">Kubernetes</h3>
<p>To monitor and manage container lifecycles in more complex environments, you'll need to turn to a container orchestration tool. While Docker includes its own orchestration tool (called Docker Swarm), most developers choose Kubernetes instead.</p>
<p>Kubernetes is an open-source container orchestration platform descended from a project developed for internal use at Google.</p>
<p>Kubernetes schedules and automates tasks integral to the management of container-based architectures, including container deployment, updates, service discovery, storage provisioning, load balancing, health monitoring, and more.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782669921/e75d6b2a-b0b3-4591-8a6d-75760ee40bcd.png" alt="Kubernetes" /></p>
<h2 id="heading-next-steps-and-credits">Next steps and Credits</h2>
<p>Visit the official Docker website to learn more. All major clouds e.g. Azure, AWS, and Google Cloud have Container offerings, visit their sites for more info. Credits: https://aws.amazon.com/docker/ https://www.ibm.com/cloud/learn/docker https://www.docker.com/ https://docs.microsoft.com/en-us/dotnet/architecture/microservices/container-docker-introduction/docker-defined</p>
]]></content:encoded></item><item><title><![CDATA[🆕 SQL Server 2022 First Look - Top 5 New Features (Bonus 5 Features)]]></title><description><![CDATA[Microsoft announced the first private preview of SQL Server 2022 claiming "the most Azure-enabled release of SQL Server yet, with continued innovation in performance, security, and availability".
In this post, we're going to have a look at top 5 most...]]></description><link>https://read.satishyadav.com/sql-server-2022-first-look-top-5-new-features-bonus-5-features</link><guid isPermaLink="true">https://read.satishyadav.com/sql-server-2022-first-look-top-5-new-features-bonus-5-features</guid><category><![CDATA[SQL Server]]></category><category><![CDATA[Databases]]></category><category><![CDATA[SQL Server 2022]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Fri, 05 Nov 2021 06:57:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782678034/c43662f7-3d3a-4faa-b164-bb0463395688.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Microsoft <a target="_blank" href="https://cloudblogs.microsoft.com/sqlserver/2021/11/02/announcing-sql-server-2022-preview-azure-enabled-with-continued-performance-and-security-innovation/">announced</a> the first private preview of SQL Server 2022 claiming "the most Azure-enabled release of SQL Server yet, with continued innovation in performance, security, and availability".</p>
<p>In this post, we're going to have a look at top 5 most interesting features.</p>
<h2 id="heading-5-ledger-blockchain-support">5. Ledger (Blockchain) Support</h2>
<p>SQL Server 2022 introduces new Ledger capabilities for creating Blockchain-like immutable records to ensure data integrity. If somebody modifies the record, it would no longer be valid.</p>
<p>It would be beneficial for scenarios such as internal and external audits.</p>
<h2 id="heading-4-peer-to-peer-replica-conflict-resolution">4. Peer-to-peer replica conflict resolution</h2>
<p>In a multi-write scenario - With SQL Server 2022, the last-write rule is being automated. Now, when a conflict is detected, the most recent modification time will be chosen to be persisted on all replicas. This helps keep your multi-write scenarios running smoothly.</p>
<p>Previously this peer-to-peer replica conflict would stall the whole operation until it was addressed.</p>
<h2 id="heading-3-intelligent-query-processing">3. Intelligent Query Processing</h2>
<p>The next generation of Intelligent Query Processing (IQP) includes solutions to some of the most common problems we face today, without any code changes required including:</p>
<p><code>MAXDOP</code> and <code>CE</code> model feedback using the Query store to create a feedback cycle to automatically adapt and resolve problems with common query patterns.</p>
<h2 id="heading-2-parameter-sensitive-query-plan-caching">2. Parameter Sensitive Query Plan Caching</h2>
<p>SQL Server has a great Query Optimizer, but one of the issues faced by a lot of people is Parameter Sniffing. SQL Server caches the execution plan for a Stored Procedure based on certain parameters (sniffing the parameters). This is usually good but it might not necessarily be efficient with another set of parameters.</p>
<p>SQL Server 2022 introduces Parameter Sensitive Plan Optimization which can cache multiple plans based on parameters - without requiring any code change.</p>
<p>Before revealing my top pick, let's see some honourable Mentions:</p>
<ul>
<li><p>Query Store is now turned on by default.</p>
</li>
<li><p>Read Replica Support for Query Store - you can now use Query Store for your Read-Only workloads of your AG (Available Group).</p>
</li>
<li><p>New extensions to the T-SQL language to support data virtualization and backup/restore with S3-compatible storage systems. Furthermore, T-SQL will support new JSON functions and time-series capabilities.</p>
</li>
<li><p>Azure Synapse Link - Previously, moving data from on-premises databases, like SQL Server, to Synapse required you to use ETL. Azure Synapse Link for SQL Server 2022 provides automatic change feeds that capture the changes within SQL Server and feed those into Azure Synapse Analytics. It provides near real-time analysis and hybrid transactional and analytical processing with minimal impact on operational systems.</p>
</li>
<li><p><a target="_blank" href="https://azure.microsoft.com/en-in/services/purview/">Azure Purview</a> Integration - Azure Purview is a unified data governance and management service. SQL Server 2022 is integrated with Azure Purview for greater data discovery, allowing you to break down data silos. Through this integration you will be able to:</p>
<ul>
<li><p>Automatically scan your on-premises SQL Server for free to capture metadata.</p>
</li>
<li><p>Classify data using built-in and custom classifiers and Microsoft Information Protection sensitivity labels.</p>
</li>
<li><p>Set up and control specific access rights to SQL Server.</p>
</li>
</ul>
</li>
</ul>
<p>Now for the last feature:</p>
<h2 id="heading-1-fully-managed-disaster-recovery-in-the-cloud">1. Fully Managed Disaster Recovery in the Cloud</h2>
<p>Using SQL Server 2022 and the new link feature for Azure SQL Managed Instance, you now get all the benefits of running a PaaS environment applied to disaster recovery—allowing you to spend less time on setup and management even when compared to an IaaS environment. This works by using a built-in Distributed Availability Group (DAG) to replicate data to a previously deployed Azure SQL Managed Instance as a DR replica site. The instance is ready and waiting for whenever you need it—no lengthy configuration or maintenance is required. You can also use this link feature in read scale-out scenarios to offload heavy requests that might otherwise affect database performance.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782675933/252a3df3-dae4-4e57-95a9-139a2e1a7c56.png" alt="SQL Server Managed Cloud DR" /></p>
<p>Did I miss any other cool feature? Let me know.</p>
<p>Happy Coding! 👨‍💻</p>
]]></content:encoded></item><item><title><![CDATA[How to setup and use DynamoDb Locally - Free]]></title><description><![CDATA[Did you know DynamoDB from AWS has a locally downloadable version which you can install on your local machine and use for development and testing purposes.
As a newbie to AWS, I was unable to find any comprehensive guide on how to setup and use Dynam...]]></description><link>https://read.satishyadav.com/how-to-setup-and-use-dynamodb-locally-free</link><guid isPermaLink="true">https://read.satishyadav.com/how-to-setup-and-use-dynamodb-locally-free</guid><category><![CDATA[DynamoDB]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Databases]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Tue, 06 Jul 2021 15:41:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/dpbXgTh0Lac/upload/73581e9a94353db388851d9c2e36a1a5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Did you know DynamoDB from AWS has a locally downloadable version which you can install on your local machine and use for development and testing purposes.</p>
<p>As a newbie to AWS, I was unable to find any comprehensive guide on how to setup and use DynamoDB locally. So without further ado, let's start.</p>
<h2 id="heading-download-the-dynamodb-local-downloadable-version">Download the DynamoDB Local (Downloadable Version)</h2>
<p>There are 3 ways you can download:</p>
<ol>
<li><p>Standalone <code>jar</code> file</p>
</li>
<li><p>Using <code>Docker</code></p>
</li>
<li><p>Using an <code>Apache Maven</code></p>
</li>
</ol>
<p>I'm using Docker for this tutorial, for instructions on other 2 ways, visit this official <a target="_blank" href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html">AWS site</a></p>
<blockquote>
<p>Please note your application doesn't have to be a containerized application, we're just using DynamoDB database as a container, that's it.</p>
</blockquote>
<h2 id="heading-using-docker">Using <code>Docker</code></h2>
<p>Make sure you have docker up and running. If you've not, follow this <a target="_blank" href="https://docs.docker.com/desktop/">official instructions</a></p>
<pre><code class="lang-bash">docker run -p 8000:8000 amazon/dynamodb-local
</code></pre>
<p>This will download <code>DynamoDB</code> locally from official Docker image and run. If everything is okay, you'd see output something like this:</p>
<pre><code class="lang-bash">Initializing DynamoDB Local with the following configuration:
Port:   8000
InMemory:       <span class="hljs-literal">true</span>
DbPath: null
SharedDb:       <span class="hljs-literal">false</span>
shouldDelayTransientStatuses:   <span class="hljs-literal">false</span>
CorsParams:     *
</code></pre>
<p>This would run the fully functional DynamoDB instance at <code>http://localhost:8000</code>.</p>
<h2 id="heading-bonus-verify-installation-using-aws-cli">[Bonus] Verify installation using AWS CLI.</h2>
<p>If don't have AWS CLI installed, follow <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">this official guide</a></p>
<p>Run this command to verify the installation</p>
<pre><code class="lang-bash">aws dynamodb list-tables --endpoint-url http://localhost:8000
</code></pre>
<p>If you get an error like this:</p>
<pre><code class="lang-bash">You must specify a region. You can also configure your region by running <span class="hljs-string">"aws configure"</span>.
</code></pre>
<p>You can run:</p>
<pre><code class="lang-bash">aws configure
</code></pre>
<p>And you'd be asked to setup follwoing:</p>
<pre><code class="lang-bash">AWS Access Key ID:
AWS Secret Access Key :
Default region name [x]:
Default output format [None]:
</code></pre>
<p>You can enter any values, as you're only using DynamoDB locally.</p>
<p>That's it!</p>
<p>That's how you can configure AWS DynamoDB on your local machine to develop and test your applications without spending anything.</p>
<p>Happy Coding!</p>
<p>Originally posted at my blog: <a target="_blank" href="https://shawt.io/r/sYW">https://blog.satishyadav.com/how-to-setup-and-use-dynamodb-locally-free</a></p>
]]></content:encoded></item><item><title><![CDATA[.NET 6 LINQ New Features]]></title><description><![CDATA[What is .NET 6 and why should I care?
.NET 6 is the upcoming major overhaul for .NET. It unifies entire .NET experience. No more .NET Core, .NET Full Framework, Xamarin, Mono, etc. Just a single .NET.
New LINQ Features
At the time of writing this pos...]]></description><link>https://read.satishyadav.com/net-6-linq-new-features</link><guid isPermaLink="true">https://read.satishyadav.com/net-6-linq-new-features</guid><category><![CDATA[linq]]></category><category><![CDATA[.net 6.0]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Sun, 04 Jul 2021 15:33:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782690211/1b1d4bc4-f8c8-48b2-a758-61f24c1e471e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-net-6-and-why-should-i-care">What is <code>.NET 6</code> and why should I care?</h2>
<p><code>.NET 6</code> is the upcoming major overhaul for <code>.NET</code>. It unifies entire <code>.NET</code> experience. No more <code>.NET Core</code>, <code>.NET Full Framework</code>, <code>Xamarin</code>, <code>Mono</code>, etc. Just a single <code>.NET</code>.</p>
<h2 id="heading-new-linq-features">New <code>LINQ</code> Features</h2>
<p>At the time of writing this post, 5 previews of <code>.NET 6</code> have been released and last couple of releases have been blessing for <code>LINQ</code>.</p>
<p>Here are few top new <code>LINQ</code> features:</p>
<ul>
<li><p>New methods <code>MaxBy</code> and <code>MinBy</code></p>
</li>
<li><p>New methods <code>Chunk</code></p>
</li>
<li><p>New methods <code>DistinctBy</code>, <code>UnionBy</code>, <code>IntersectBy</code>, and <code>ExceptBy</code></p>
</li>
<li><p><code>Index</code> and <code>Range</code> parameters</p>
</li>
<li><p>New method <code>TryGetNonEnumeratedCount</code></p>
</li>
<li><p>Default parameters for <code>FirstOrDefault</code>, <code>LastOrDefault</code>, and <code>SingleOrDefault</code></p>
</li>
<li><p><code>Zip</code> supports 3 <code>IEnumerables</code></p>
</li>
</ul>
<h2 id="heading-new-methods-maxby-and-minby">New methods <code>MaxBy</code> and <code>MinBy</code></h2>
<p>Finding out maximum or minimum has been easier than even with these new <code>MaxBy</code> or <code>MinBy</code> methods.</p>
<p>Suppose a <code>List</code> of <code>Person</code>s as:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">static</span> List&lt;Person&gt; people = <span class="hljs-keyword">new</span> List&lt;Person&gt;
{
    <span class="hljs-keyword">new</span> Person { Id = <span class="hljs-number">1</span>, Name = <span class="hljs-string">"Amit"</span>, Age = <span class="hljs-number">38</span>},
    <span class="hljs-keyword">new</span> Person { Id = <span class="hljs-number">2</span>, Name = <span class="hljs-string">"Ravi"</span>, Age = <span class="hljs-number">36</span>},
    <span class="hljs-keyword">new</span> Person { Id = <span class="hljs-number">3</span>, Name = <span class="hljs-string">"Manish"</span>, Age = <span class="hljs-number">34</span>},
    <span class="hljs-keyword">new</span> Person { Id = <span class="hljs-number">4</span>, Name = <span class="hljs-string">"Satish"</span>, Age = <span class="hljs-number">29</span>},
};
</code></pre>
<p>If we need to get maximum and minimum, currently here's how to do it:</p>
<pre><code class="lang-csharp"><span class="hljs-comment">//Without using MaxBy and MinBy</span>
Person oldestPerson = people.OrderByDescending(person =&gt; person.Age).First();
Person youngestPerson = people.OrderBy(person =&gt; person.Age).First();
Console.WriteLine(<span class="hljs-string">$"Oldest Person without using MaxBy: <span class="hljs-subst">{oldestPerson.Name}</span>"</span>);
Console.WriteLine(<span class="hljs-string">$"Youngest Person without using MaxBy: <span class="hljs-subst">{youngestPerson.Name}</span>"</span>);
</code></pre>
<p>But with <code>MaxBy</code> and <code>MinBy</code>, it's just a single method call:</p>
<pre><code class="lang-csharp">Person oldestPerson = people.MaxBy(person =&gt; person.Age);
Person youngestPerson = people.MinBy(person =&gt; person.Age);
Console.WriteLine(<span class="hljs-string">$"Oldest Person using MaxBy: <span class="hljs-subst">{oldestPerson.Name}</span>"</span>);
Console.WriteLine(<span class="hljs-string">$"Youngest Person using MaxBy: <span class="hljs-subst">{youngestPerson.Name}</span>"</span>);
</code></pre>
<p>Neat, right? Let me know in the comments if you have alternate methods of getting maximum and minimum using <code>LINQ</code>.</p>
<h2 id="heading-new-method-chunk">New method <code>Chunk</code></h2>
<p>A new method <code>Chunk</code> slices the <code>IEnumerable</code> into provided sizes. e.g. If you have a collection of 4 elements and you need to cluster them into fixed size of 2, here's how to do it:</p>
<pre><code class="lang-csharp">IEnumerable&lt;Person[]&gt; cluster = people.Chunk(<span class="hljs-number">2</span>);
<span class="hljs-comment">// Print each cluster.</span>
<span class="hljs-keyword">foreach</span>(<span class="hljs-keyword">var</span> people <span class="hljs-keyword">in</span> cluster)
{
    Console.WriteLine(<span class="hljs-string">$"Cluster of <span class="hljs-subst">{<span class="hljs-keyword">string</span>.Join(<span class="hljs-string">","</span>, people.Select(person =&gt; person.Name))}</span>"</span>);
}
<span class="hljs-comment">//Prints</span>
<span class="hljs-comment">// Cluster of Amit,Ravi</span>
<span class="hljs-comment">// Cluster of Manish,Satish</span>
</code></pre>
<h2 id="heading-new-methods-distinctby-unionby-intersectby-and-exceptby">New methods <code>DistinctBy</code>, <code>UnionBy</code>, <code>IntersectBy</code>, and <code>ExceptBy</code></h2>
<p>Existing set methods <code>Distinct</code>, <code>Union</code>, <code>Intersect</code>, and <code>Except</code> have been powered up by these new methods which can take a selector function to operate. e.g.</p>
<pre><code class="lang-csharp">IEnumerable&lt;Person&gt; evenAgedPeople = people.Where(person =&gt; person.Age % <span class="hljs-number">2</span> == <span class="hljs-number">0</span>);
<span class="hljs-comment">//Amit,Ravi,Manish</span>

IEnumerable&lt;Person&gt; personAbove35 = people.Where(person =&gt; person.Age &gt; <span class="hljs-number">35</span>);
<span class="hljs-comment">//Amit,Ravi</span>

IEnumerable&lt;Person&gt; union = evenAgedPeople.UnionBy(personAbove35, x =&gt; x.Age);
<span class="hljs-comment">//Amit,Ravi,Manish</span>

IEnumerable&lt;Person&gt; intersection = evenAgedPeople.IntersectBy(personAbove35.Select(p =&gt; p.Age), x =&gt; x.Age);
<span class="hljs-comment">//Amit,Ravi</span>
</code></pre>
<p>Let me know in the comments, the usage of <code>DistinctBy</code> and <code>ExceptBy</code>.</p>
<h2 id="heading-index-and-range-parameters"><code>Index</code> and <code>Range</code> parameters</h2>
<p><code>Range</code>: <code>..</code>, and <code>Index</code>: <code>^</code> already exist in <code>C#</code>8, <code>.NET 6</code> brings these two to <code>LINQ</code>.</p>
<ul>
<li>The <code>ElementAt</code> operator now takes indices from the end.</li>
</ul>
<pre><code class="lang-csharp">Person secondLastPerson = people.ElementAt(^<span class="hljs-number">2</span>);
<span class="hljs-comment">//Manish</span>
</code></pre>
<ul>
<li><code>Skip</code> and <code>Take</code> now take <code>Range</code> as well:</li>
</ul>
<pre><code class="lang-csharp">IEnumerable&lt;Person&gt; take3People = people.Take(.<span class="hljs-number">.3</span>);
<span class="hljs-comment">//Amit,Ravi,Manish</span>

IEnumerable&lt;Person&gt; skip1Person =  people.Take(<span class="hljs-number">1.</span>.);
<span class="hljs-comment">//Ravi,Manish,Satish</span>

IEnumerable&lt;Person&gt; take3Skip1People = people.Take(<span class="hljs-number">1.</span><span class="hljs-number">.3</span>);
<span class="hljs-comment">//Ravi,Manish</span>

IEnumerable&lt;Person&gt; takeLast2People = people.Take(^<span class="hljs-number">2.</span>.);
<span class="hljs-comment">//Manish,Satish</span>

IEnumerable&lt;Person&gt; skipLast3People = people.Take(..^<span class="hljs-number">3</span>);
<span class="hljs-comment">//Amit</span>

IEnumerable&lt;Person&gt; takeLast3SkipLast2 = people.Take(^<span class="hljs-number">3.</span>.^<span class="hljs-number">2</span>);
<span class="hljs-comment">//Ravi</span>
</code></pre>
<h2 id="heading-new-method-trygetnonenumeratedcount">New method <code>TryGetNonEnumeratedCount</code></h2>
<p>Sometimes you need to get a count without the enumeration. <code>TryGetNonEnumeratedCount</code> will try to get a count without forcing an enumeration. It internally checks for the implementation of <code>ICollection</code> i.e. <code>IEnumerable</code> - that already has a mechanism to get a count without forcing an enumeration. Otherwise, it'll try to take advantage of new improvements in <code>LINQ</code>. Useful in scenarios where you want to get a count but not at the cost of enumerating the <code>IEnumerable</code>. e.g.</p>
<pre><code class="lang-csharp">List&lt;Person&gt; anotherList = people.TryGetNonEnumeratedCount(<span class="hljs-keyword">out</span> <span class="hljs-keyword">int</span> count) ? <span class="hljs-keyword">new</span> List&lt;Person&gt;(count): <span class="hljs-keyword">new</span> List&lt;Person&gt;();
anotherList.AddRange(people);
</code></pre>
<p>In our case right now, we know that people is just an in-memory list, but what if it was from a database of some <code>Stream</code>, then it would've made sense to find out the count to optimize the instantiation of <code>anotherList</code> object by specifying <code>capacity</code> parameter.</p>
<h2 id="heading-default-parameters-for-firstordefault-lastordefault-and-singleordefault">Default parameters for <code>FirstOrDefault</code>, <code>LastOrDefault</code>, and <code>SingleOrDefault</code></h2>
<p>Current <code>FirstOrDefault</code>, <code>LastOrDefault</code>, and <code>SingleOrDefault</code> methods return <code>default(T)</code> if the source <code>IEnumerable</code> is empty. The new overloads accept a parameter that will be returned if the source is empty.</p>
<p>e.g.</p>
<pre><code class="lang-csharp">List&lt;<span class="hljs-keyword">int</span>&gt; emptyList = <span class="hljs-keyword">new</span> List&lt;<span class="hljs-keyword">int</span>&gt;();
<span class="hljs-keyword">int</span> <span class="hljs-keyword">value</span> = emptyList.FirstOrDefault(<span class="hljs-number">-1</span>);
<span class="hljs-comment">//-1 instead of 0</span>
</code></pre>
<p>This reminds me of <code>ISNULL</code> function of <code>SQL Server</code>.</p>
<h2 id="heading-zip-supports-3-ienumerables"><code>Zip</code> supports 3 <code>IEnumerables</code></h2>
<p>Before <code>.NET 6</code>, <a target="_blank" href="https://docs.microsoft.com/en-gb/dotnet/api/system.linq.enumerable.zip?view=net-5.0"><code>Zip</code></a> used to take only 2 parameters. Now it takes 3 parameters:</p>
<pre><code class="lang-csharp">IEnumerable&lt;<span class="hljs-keyword">int</span>&gt; ids = Enumerable.Range(<span class="hljs-number">1</span>, <span class="hljs-number">4</span>);
IEnumerable&lt;Person&gt; allPeople = people;
IEnumerable&lt;<span class="hljs-keyword">int</span>&gt; allAges = people.Select(person =&gt; person.Age);

IEnumerable&lt;(<span class="hljs-keyword">int</span> Id, Person Person, <span class="hljs-keyword">int</span> Age)&gt; zipped = ids.Zip(allPeople, allAges);
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p><code>.NET 6</code> previews bring an awesome set of new features with every new release. Let me know in the comments which features you're excited about.</p>
<h2 id="heading-next-steps">Next Steps</h2>
<ul>
<li><p>Download <a target="_blank" href="https://dotnet.microsoft.com/download/dotnet/6.0"><code>.NET 6</code></a> today and try it out.</p>
</li>
<li><p>The source code is available at: <a target="_blank" href="https://shawt.io/r/sYT">https://github.com/iSatishYadav/.net-6-linq-new-features</a></p>
</li>
</ul>
<blockquote>
<p>Originally published at my blog at: <a target="_blank" href="https://shawt.io/r/sYS">https://blog.satishyadav.com/.net-6-linq-new-features</a></p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Visual Studio 2022 will write code for you!!! - Visual Studio 2022 Series - Part 1]]></title><description><![CDATA[Introduction
Visual Studio 2022 Preview 1 is now available! If you've missed the official announcement on June 17th, 2021 - check it out. If you want to try out, head over to the official download page here.
The Visual Studio 2022 previews can be ins...]]></description><link>https://read.satishyadav.com/visual-studio-2022-will-write-code-for-you-visual-studio-2022-series-part-1</link><guid isPermaLink="true">https://read.satishyadav.com/visual-studio-2022-will-write-code-for-you-visual-studio-2022-series-part-1</guid><category><![CDATA[visual studio]]></category><category><![CDATA[copilot]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Satish Yadav]]></dc:creator><pubDate>Fri, 18 Jun 2021 11:15:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782727543/1cbabcab-72da-42e1-9bde-fd641c3b4086.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Visual Studio 2022 Preview 1 is now available! If you've missed the <a target="_blank" href="https://devblogs.microsoft.com/visualstudio/visual-studio-2022-preview-1-now-available/">official announcement</a> on June 17th, 2021 - check it out. If you want to try out, head over to the official download page <a target="_blank" href="https://visualstudio.microsoft.com/vs/preview/vs2022/">here</a>.</p>
<p>The Visual Studio 2022 previews can be installed side-by-side with earlier versions of Visual Studio, are available in all three editions (Community, Pro, and Enterprise), and are free to use.</p>
<h2 id="heading-new-features">New Features</h2>
<p>A lot of new features have come out in this release, however, Visual Studio 2022 is just out with Preview 1, meaning there will be more and more new features coming in new Previews.</p>
<p>But today I want to talk about 2 of my favorite features:</p>
<ul>
<li><p>64-bit</p>
</li>
<li><p>IntelliCode</p>
</li>
</ul>
<h3 id="heading-64-bit">64-bit</h3>
<p>The first and the biggest feature is - and boy, that's big one - it's 64-bit!!! 😍 This means - Visual Studio 2022 will no longer be limited to ~4gb of memory in the main <code>devenv.exe</code> process.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782712155/4686eb91-50a8-4d00-bb94-4a7ff1dc3972.png" alt="Visual Studio 2022 64-bit" /></p>
<p>In Microsoft's own words:</p>
<blockquote>
<p>With a 64-bit Visual Studio on Windows, you can open, edit, run, and debug even the biggest and most complex solutions without running out of memory.</p>
</blockquote>
<p>This doesn't mean you can't develop 32-bit applications using Visual Studio 2022, it just means the Visual Studio itself wil be able to fully utilize your 64-bit hardware.</p>
<h3 id="heading-intellicode-one-step-further">IntelliCode - one step further</h3>
<p>This one's my favorite new feature. We all know and love <a target="_blank" href="https://visualstudio.microsoft.com/services/intellicode/">IntelliCode</a> - Microsoft's AI-enabled Visual Studio component which suggests code changes using Machine Learning Model based on 1000s of Open-Source GitHub repositories and optionally your own repositories if you permit.</p>
<p>In Visual Studio 2022, IntelliCode has gone one step further and not only will suggest the code changes, but it'll also will write the code for you 😲. Look at this GIF:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687782724123/0a2f1f1a-72db-4830-9d48-b26150855e8a.gif" alt="Visual Studio 2022 G4-bit" /></p>
<ul>
<li><p>As soon as I write <code>StringBuilder</code>, it knows what I'm about to write and with the <code>TAB</code> press, it writes <code>StringBuilder sb = new StringBuilder();</code> for me.</p>
</li>
<li><p>Similarly in the <code>foreach</code> loop, it know I'm going to append the <code>item</code> to the <code>StringBuilder</code> and writes <code>sb.Append(item)</code> for me.</p>
</li>
<li><p>Finally after the loop it knows I want to print it, so it prints using <code>Console.WriteLine</code> by calling <code>ToString()</code> on the <code>StringBuilder</code> reference <code>sb</code>.</p>
</li>
</ul>
<p>Cool, right!!!</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This is just a Preview 1, there will be at-lest 4-5 previews before it hits GA - General Availability. So watch out for more posts.</p>
<p>Let me know which features ya'll are excited about.</p>
<h2 id="heading-next-steps">Next Steps</h2>
<ul>
<li><p>Read more about <a target="_blank" href="https://visualstudio.microsoft.com/services/intellicode/">IntelliCode</a>.</p>
</li>
<li><p>Check out the <a target="_blank" href="https://devblogs.microsoft.com/visualstudio/visual-studio-2022-preview-1-now-available/">Official announcement</a></p>
</li>
<li><p>Download <a target="_blank" href="https://visualstudio.microsoft.com/vs/preview/vs2022/">Visual Studio 2022</a> and try it now.</p>
</li>
</ul>
<blockquote>
<p>Originally Posted at: https://blog.satishyadav.com/Visual-Studio-2022-will-write-code-for-you/</p>
</blockquote>
<p>Happy Coding! 👨‍💻</p>
]]></content:encoded></item></channel></rss>