<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pramesh Kc.</title>
    <description>The latest articles on DEV Community by Pramesh Kc. (@prameshkc).</description>
    <link>https://dev.to/prameshkc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1235819%2F5b6de42f-9263-4ef4-84f1-8151e359e655.jpeg</url>
      <title>DEV Community: Pramesh Kc.</title>
      <link>https://dev.to/prameshkc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prameshkc"/>
    <language>en</language>
    <item>
      <title>The Ultimate Guide to .NET Performance Testing with BenchmarkDotNet</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Sat, 30 Nov 2024 09:39:57 +0000</pubDate>
      <link>https://dev.to/prameshkc/the-ultimate-guide-to-net-performance-testing-with-benchmarkdotnet-3ka2</link>
      <guid>https://dev.to/prameshkc/the-ultimate-guide-to-net-performance-testing-with-benchmarkdotnet-3ka2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Have you ever wondered if your code could run faster? Or maybe you're choosing between different ways to write something and aren't sure which is better? That's where benchmarking comes in! It's like a stopwatch for your code that helps you make smart decisions about how to write your programs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why BenchmarkDotNet?
&lt;/h2&gt;

&lt;p&gt;BenchmarkDotNet stands out for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Statistical analysis to ensure reliable results&lt;/li&gt;
&lt;li&gt;Cross-platform support (.NET Core, .NET Framework, Mono)&lt;/li&gt;
&lt;li&gt;Hardware intrinsics reporting&lt;/li&gt;
&lt;li&gt;Easy-to-read reports in various formats (JSON, HTML, CSV)&lt;/li&gt;
&lt;li&gt;Memory allocation and garbage collection statistics&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your First Steps into Benchmarking
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Setting Up Your Project
&lt;/h3&gt;

&lt;p&gt;First, create a new console application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new console &lt;span class="nt"&gt;-n&lt;/span&gt; MyFirstBenchmark
&lt;span class="nb"&gt;cd &lt;/span&gt;MyFirstBenchmark
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, add the BenchmarkDotNet package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package BenchmarkDotNet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Your First Benchmark
&lt;/h3&gt;

&lt;p&gt;Let's create a simple benchmark that compares different ways to join strings - something every developer does! Here's a beginner-friendly example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;BenchmarkDotNet.Attributes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;BenchmarkDotNet.Running&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StringBenchmarks&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// This is our test data&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;firstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;lastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Smith"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;UsingPlusOperator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Hello, "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;firstName&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;lastName&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;UsingStringInterpolation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;$"Hello, &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// This is where we run our benchmarks&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;BenchmarkRunner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;StringBenchmarks&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Running Your Benchmark
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your terminal&lt;/li&gt;
&lt;li&gt;Navigate to your project folder&lt;/li&gt;
&lt;li&gt;Run this command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet run &lt;span class="nt"&gt;-c&lt;/span&gt; Release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-c Release&lt;/code&gt; part is important! Always run benchmarks in Release mode for accurate results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Your Results
&lt;/h2&gt;

&lt;p&gt;When your benchmark finishes, you'll see a table like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|               Method |     Mean |    Error |
|-------------------- |---------:|---------:|
|UsingPlusOperator    | 45.23 ns | 0.85 ns  |
|UsingInterpolation   | 43.12 ns | 0.81 ns  |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down what these numbers mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mean&lt;/strong&gt;: The average time it took to run (in nanoseconds here)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error&lt;/strong&gt;: How much the results might vary&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ns&lt;/strong&gt; means nanoseconds (that's really, really fast!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Memory Diagnostics
&lt;/h3&gt;

&lt;p&gt;To measure memory allocations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;BenchmarkDotNet.Attributes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;BenchmarkDotNet.Running&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;MemoryDiagnoser&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StringBenchmarks&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Baseline&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;UsingPlus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Hello, "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;UsingInterpolation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;$"Hello, &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;BenchmarkRunner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;StringBenchmarks&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding Results
&lt;/h3&gt;

&lt;p&gt;Your output will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|            Method |     Mean |    Error |   StdDev |  Allocated |
|------------------|----------|----------|-----------|------------|
|        UsingPlus | 12.23 ns | 0.123 ns | 0.115 ns |      24 B |
| UsingInterpolation| 11.45 ns | 0.118 ns | 0.110 ns |      24 B |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key metrics explained:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mean: Average time per operation&lt;/li&gt;
&lt;li&gt;Error: Statistical error margin&lt;/li&gt;
&lt;li&gt;StdDev: How much results vary&lt;/li&gt;
&lt;li&gt;Allocated: Memory used&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Collection Performance
&lt;/h3&gt;

&lt;p&gt;Compare different collection types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;MemoryDiagnoser&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CollectionBenchmarks&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;Params&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Size&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;List&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;list&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
            &lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
            &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Async Operations
&lt;/h3&gt;

&lt;p&gt;Benchmarking async code requires special attention:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AsyncBenchmarks&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;HttpClient&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;AsyncDownload&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://example.com"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;AsyncDownloadWithTimeout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cts&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;CancellationTokenSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TimeSpan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Token&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Mistakes to Avoid
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;❌ Don't run benchmarks in Debug mode&lt;/li&gt;
&lt;li&gt;❌ Don't benchmark with tiny amounts of work&lt;/li&gt;
&lt;li&gt;❌ Don't ignore the warm-up phase&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tips for Success
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;✅ Always use Release mode&lt;/li&gt;
&lt;li&gt;✅ Test with realistic data&lt;/li&gt;
&lt;li&gt;✅ Run benchmarks multiple times&lt;/li&gt;
&lt;li&gt;✅ Keep your test cases simple at first&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;Once you're comfortable with these basics, you can try:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Testing different sizes of data&lt;/li&gt;
&lt;li&gt;Comparing different .NET versions&lt;/li&gt;
&lt;li&gt;Measuring memory usage&lt;/li&gt;
&lt;li&gt;Benchmarking your own code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Remember&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with simple comparisons&lt;/li&gt;
&lt;li&gt;Always run in Release mode&lt;/li&gt;
&lt;li&gt;Use realistic data&lt;/li&gt;
&lt;li&gt;Take your time understanding the results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't need to be an expert to start benchmarking! Begin with these simple examples, and as you get more comfortable, you can explore more advanced features.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What’s New in .NET 9: A Simple Guide for Developers</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Tue, 26 Nov 2024 10:14:05 +0000</pubDate>
      <link>https://dev.to/prameshkc/whats-new-in-net-9-a-simple-guide-for-developers-nkf</link>
      <guid>https://dev.to/prameshkc/whats-new-in-net-9-a-simple-guide-for-developers-nkf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;.NET 9 has arrived with a focus on cloud-native applications, performance improvements, and developer productivity. This release is packed with updates for runtime, libraries, tools, and frameworks like ASP.NET Core, .NET MAUI, and Entity Framework Core. Let’s dive into the features in simple language to help you get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Platform Updates
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Runtime Improvements
&lt;/h3&gt;

&lt;h4&gt;
  
  
  New Feature Switch System
&lt;/h4&gt;

&lt;p&gt;The .NET 9 runtime introduces a sophisticated attribute model for feature switches with enhanced trimming support. This system allows libraries to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define toggleable functionality areas&lt;/li&gt;
&lt;li&gt;Maintain better control over feature availability&lt;/li&gt;
&lt;li&gt;Optimize application size through improved trimming&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Advanced Garbage Collection
&lt;/h4&gt;

&lt;p&gt;The new garbage collection system brings significant improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic adaptation to application size (enabled by default)&lt;/li&gt;
&lt;li&gt;Replaces traditional Server GC&lt;/li&gt;
&lt;li&gt;Optimizes memory management based on real-time usage patterns&lt;/li&gt;
&lt;li&gt;Reduces memory footprint while maintaining performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Performance Optimizations
&lt;/h4&gt;

&lt;p&gt;Substantial performance improvements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enhanced loop optimization algorithms&lt;/li&gt;
&lt;li&gt;Smarter inlining capabilities&lt;/li&gt;
&lt;li&gt;Improved Arm64 vectorization&lt;/li&gt;
&lt;li&gt;Optimized code generation for modern hardware&lt;/li&gt;
&lt;li&gt;Reduced memory overhead in common operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Library Enhancements
&lt;/h3&gt;

&lt;h4&gt;
  
  
  System.Text.Json Updates
&lt;/h4&gt;

&lt;p&gt;The JSON handling capabilities have been significantly expanded:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full support for nullable reference type annotations&lt;/li&gt;
&lt;li&gt;JSON schema export functionality from .NET types&lt;/li&gt;
&lt;li&gt;Customizable JSON indentation options&lt;/li&gt;
&lt;li&gt;Multi-root JSON value reading from single streams&lt;/li&gt;
&lt;li&gt;Improved performance for large JSON documents&lt;/li&gt;
&lt;li&gt;Better handling of complex object graphs&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  LINQ Enhancements
&lt;/h4&gt;

&lt;p&gt;New LINQ methods provide more efficient data operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CountBy&lt;/code&gt;: Efficiently count elements by key without intermediate collections&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AggregateBy&lt;/code&gt;: Perform aggregations by key without GroupBy overhead&lt;/li&gt;
&lt;li&gt;Improved performance for existing LINQ operations&lt;/li&gt;
&lt;li&gt;Better memory utilization in LINQ queries&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Collection Improvements
&lt;/h4&gt;

&lt;p&gt;Priority Queue enhancements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New Remove method with comprehensive comparison options&lt;/li&gt;
&lt;li&gt;Improved performance for common operations&lt;/li&gt;
&lt;li&gt;Better memory efficiency for large queues&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cryptography Updates
&lt;/h4&gt;

&lt;p&gt;New cryptographic capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-shot hash method on CryptographicOperations&lt;/li&gt;
&lt;li&gt;KMAC algorithm implementation&lt;/li&gt;
&lt;li&gt;Enhanced security features&lt;/li&gt;
&lt;li&gt;Improved performance for common cryptographic operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Reflection Capabilities
&lt;/h4&gt;

&lt;p&gt;The new PersistedAssemblyBuilder brings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ability to save emitted assemblies&lt;/li&gt;
&lt;li&gt;Full PDB support for debugging&lt;/li&gt;
&lt;li&gt;Symbol information generation&lt;/li&gt;
&lt;li&gt;Enhanced debugging capabilities for generated code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Artificial Intelligence Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  AI Building Blocks
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Microsoft.Extensions.AI
&lt;/h4&gt;

&lt;p&gt;New unified C# abstractions for AI services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Seamless integration with language models&lt;/li&gt;
&lt;li&gt;Embedding support&lt;/li&gt;
&lt;li&gt;Vector store capabilities&lt;/li&gt;
&lt;li&gt;Flexible middleware options&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Tensor Operations
&lt;/h4&gt;

&lt;p&gt;TensorPrimitives and Tensor improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nearly 200 optimized method overloads&lt;/li&gt;
&lt;li&gt;SIMD-optimized operations&lt;/li&gt;
&lt;li&gt;Generic support for numerical operations&lt;/li&gt;
&lt;li&gt;Zero-copy interop with major AI libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ML.NET 4.0 Features
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Core Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Programmatic MLContext configuration&lt;/li&gt;
&lt;li&gt;Stream-based ONNX model loading&lt;/li&gt;
&lt;li&gt;Enhanced DataFrame capabilities&lt;/li&gt;
&lt;li&gt;Advanced tokenization features&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Experimental Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;TorchSharp ports of Llama models&lt;/li&gt;
&lt;li&gt;Phi family model support&lt;/li&gt;
&lt;li&gt;CausalLM pipeline APIs&lt;/li&gt;
&lt;li&gt;Improved model training capabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tokenizer Updates
&lt;/h3&gt;

&lt;p&gt;The Microsoft.ML.Tokenizers library now supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tiktoken for GPT models&lt;/li&gt;
&lt;li&gt;Llama tokenization&lt;/li&gt;
&lt;li&gt;CodeGen support&lt;/li&gt;
&lt;li&gt;Phi2 tokenization&lt;/li&gt;
&lt;li&gt;WordPiece and Bert implementations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Web Development
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ASP.NET Core Updates
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Security Enhancements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Secure-by-default configurations&lt;/li&gt;
&lt;li&gt;Enhanced authentication APIs&lt;/li&gt;
&lt;li&gt;Improved authorization capabilities&lt;/li&gt;
&lt;li&gt;Better HTTPS development support on Linux&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Performance Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Optimized static file handling&lt;/li&gt;
&lt;li&gt;Automatic asset versioning&lt;/li&gt;
&lt;li&gt;Reduced memory usage&lt;/li&gt;
&lt;li&gt;Faster startup times&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Blazor Updates
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;New application templates&lt;/li&gt;
&lt;li&gt;Improved component rendering&lt;/li&gt;
&lt;li&gt;Enhanced reconnection handling&lt;/li&gt;
&lt;li&gt;Better server-side performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  API Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Built-in OpenAPI document generation&lt;/li&gt;
&lt;li&gt;Enhanced native AOT support&lt;/li&gt;
&lt;li&gt;Improved API versioning&lt;/li&gt;
&lt;li&gt;Better performance for common API operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Mobile and Desktop Development
&lt;/h2&gt;

&lt;h3&gt;
  
  
  .NET MAUI Enhancements
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Performance Updates
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Optimized CollectionView and CarouselView&lt;/li&gt;
&lt;li&gt;Improved control lifecycle management&lt;/li&gt;
&lt;li&gt;Better memory utilization&lt;/li&gt;
&lt;li&gt;Enhanced startup performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  New Controls and Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Windows TitleBar control&lt;/li&gt;
&lt;li&gt;HybridWebView for web content&lt;/li&gt;
&lt;li&gt;Enhanced keyboard support&lt;/li&gt;
&lt;li&gt;Improved application lifecycle events&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Platform-Specific Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;iOS and Mac Catalyst optimizations&lt;/li&gt;
&lt;li&gt;Windows-specific enhancements&lt;/li&gt;
&lt;li&gt;Better cross-platform consistency&lt;/li&gt;
&lt;li&gt;Improved native feature access&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Development Tools and SDK
&lt;/h2&gt;

&lt;h3&gt;
  
  
  SDK Improvements
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Workload Management
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Unified workload versioning&lt;/li&gt;
&lt;li&gt;Better version control&lt;/li&gt;
&lt;li&gt;Simplified updates&lt;/li&gt;
&lt;li&gt;Enhanced compatibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Testing and Security
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Parallel test execution&lt;/li&gt;
&lt;li&gt;Comprehensive security audits&lt;/li&gt;
&lt;li&gt;Improved build logging&lt;/li&gt;
&lt;li&gt;Version mismatch detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Language Updates
&lt;/h3&gt;

&lt;h4&gt;
  
  
  C# 13 Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;params collections&lt;/li&gt;
&lt;li&gt;New &lt;code&gt;lock&lt;/code&gt; semantics&lt;/li&gt;
&lt;li&gt;Escape sequence improvements=  &lt;code&gt;\e&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Method group enhancements&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ref locals&lt;/code&gt; and &lt;code&gt;unsafe&lt;/code&gt; contexts in iterators and async methods&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ref struct&lt;/code&gt; capabilities&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;field&lt;/code&gt; backed properties (preview)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  F# 9 Enhancements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Nullable reference types&lt;/li&gt;
&lt;li&gt;Discriminated union improvements&lt;/li&gt;
&lt;li&gt;Enhanced active patterns&lt;/li&gt;
&lt;li&gt;REPL improvements&lt;/li&gt;
&lt;li&gt;Collection functions&lt;/li&gt;
&lt;li&gt;C# collection expression support&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data Access and Entity Framework
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Entity Framework Core Updates
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Azure Cosmos DB Integration
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Improved NoSQL support&lt;/li&gt;
&lt;li&gt;Better performance&lt;/li&gt;
&lt;li&gt;Enhanced query capabilities&lt;/li&gt;
&lt;li&gt;Optimized data operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Performance Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Steps toward AOT compilation&lt;/li&gt;
&lt;li&gt;Pre-compiled queries&lt;/li&gt;
&lt;li&gt;Reduced memory usage&lt;/li&gt;
&lt;li&gt;Faster query execution&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  .NET Aspire
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cloud-Native Application Development
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Dashboard Improvements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Enhanced monitoring capabilities&lt;/li&gt;
&lt;li&gt;Better resource management&lt;/li&gt;
&lt;li&gt;Improved visualization&lt;/li&gt;
&lt;li&gt;Real-time updates&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Integration Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;New service integrations&lt;/li&gt;
&lt;li&gt;Flexible APIs&lt;/li&gt;
&lt;li&gt;Enhanced development experience&lt;/li&gt;
&lt;li&gt;Better production readiness&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices and Migration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Upgrading to .NET 9
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Preparation Steps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Review existing codebase compatibility&lt;/li&gt;
&lt;li&gt;Update dependencies&lt;/li&gt;
&lt;li&gt;Test application functionality&lt;/li&gt;
&lt;li&gt;Deploy updates systematically&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Migration Considerations
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Review breaking changes&lt;/li&gt;
&lt;li&gt;Update deprecated features&lt;/li&gt;
&lt;li&gt;Test performance impacts&lt;/li&gt;
&lt;li&gt;Verify security implications&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;.NET 9 is packed with features that cater to developers building modern apps. Whether you’re working on cloud-native projects, AI solutions, or web apps, this release brings tools to make your job easier, faster, and more efficient.&lt;/p&gt;

&lt;p&gt;Whether you're building web applications, mobile apps, or AI-powered solutions, .NET 9 offers compelling reasons to upgrade. The improved performance, enhanced security, and new features across all areas of the framework make it a worthy upgrade for existing projects and an excellent choice for new development efforts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;To begin working with .NET 9:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the latest SDK from Microsoft's website&lt;/li&gt;
&lt;li&gt;Review the official documentation&lt;/li&gt;
&lt;li&gt;Test your existing applications for compatibility&lt;/li&gt;
&lt;li&gt;Start exploring the new features in a development environment&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Straight Paths: Non-Tech Essentials</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Thu, 01 Feb 2024 07:52:31 +0000</pubDate>
      <link>https://dev.to/prameshkc/tech-careers-uncomplicated-non-tech-edition-1epf</link>
      <guid>https://dev.to/prameshkc/tech-careers-uncomplicated-non-tech-edition-1epf</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Many individuals may be experiencing a sense of being stuck in a job that no longer excites them. Many people might have thought about working in the growing tech industry but thought it wasn't possible because they don't have a technical background.&lt;/p&gt;

&lt;p&gt;We’re encircled by the wonders of modern technology. In a  world driven by technology, the possibilities of transitioning from non-technical background to a career in the tech industry may seem like an overwhelming obstacle. However, many have successfully made this journey possible, breaking through barriers and embracing the opportunities that tech world offers.&lt;/p&gt;

&lt;h2&gt;
  
  
  OVERCOMING DOUBTS:
&lt;/h2&gt;

&lt;p&gt;It's natural to be accompanied by doubts and uncertainties. Questions like "Can I really do this?" or "Is it too late to learn?" may cross your mind. Acknowledge these doubts, but also recognize that many successful tech professionals started from scratch, armed only with a determination to learn, and grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  WHY TECH JOBS ARE AWESOME: WIN-WIN VIBES
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Good Pay&lt;/strong&gt;: Tech jobs usually pay well, which means more money for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feel Good at Work&lt;/strong&gt;: Solving tricky problems and working on cool projects can make your job super satisfying. Work Flexibility: Many tech jobs let you work from anywhere, helping you balance your life better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible Work Culture&lt;/strong&gt;: Many tech jobs let you work from anywhere, helping you balance your life better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Growth Opportunities&lt;/strong&gt;: Tech companies give you lots of chances to learn and grow in your career. You can move up at your own speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  YOU'RE NOT ALONE: BREAKING THE "NON-TECHNICAL" MYTH
&lt;/h2&gt;

&lt;p&gt;If you consider yourself "non-technical," don't let that misconception limit your potential. The tech industry is inclusive, with abundant resources and opportunities awaiting diverse skill sets. The tech world is more than just code. There are various roles like project management, marketing, and sales that need different skills. The tech industry is open to everyone, offering plenty of chances for diverse talents. Don't limit your potential – there's a place for you in tech beyond coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  UNDERSTANDING TECH WITHOUT CODING
&lt;/h2&gt;

&lt;p&gt;Being "non-technical" doesn't mean you're clueless about tech – it just means you have different skills.&lt;/p&gt;

&lt;p&gt;Knowing tech basics, keeping up with tech news, and being good at problem-solving are valuable skills. &lt;br&gt;
In a world full of tech, having a basic understanding is like having a map. It's not about being a coding expert but knowing enough to work well with those who are. It's like speaking a common language to make sure everyone is on the same page. Whether you love coding or not, there's a place for you in the diverse tech world.&lt;/p&gt;

&lt;h2&gt;
  
  
  THERE’RE PLENTY OF OPPORTUNITIES FOR NON-TECHNICAL PERSON
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: As a project manager, you oversee the development and execution of tech projects.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Strong organizational skills, communication, and the ability to understand technical requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Customer Support and Success:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Providing excellent customer support and ensuring customer success.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Communication, problem-solving, and empathy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quality Assurance (QA) Software Testing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Ensuring the functionality and quality of software before release is critical.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Attention to detail, problem-solving, and the ability to follow testing protocols.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Analysis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Analysing data is essential for making informed business decisions.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Analytical skills, attention to detail, and the ability to derive insights from data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Technical Writing and Documentation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Documenting processes, creating user guides, and writing technical documentation.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Clear communication, writing skills, and the ability to explain complex concepts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Social Media Marketing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Social media is a powerful tool for tech companies to connect with their audience.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Understanding of social media platforms, content creation, analytics, and strategic thinking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SEO (Search Engine Optimization)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Opportunity&lt;/strong&gt;: Tech companies rely on SEO to improve their online visibility and reach a wider audience.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Skills Needed&lt;/strong&gt;: Knowledge of SEO strategies, keyword research, analytics, and staying updated on search engine algorithms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tech industry is a vast ecosystem that welcomes individuals with a variety of skills, not just technical expertise. Social media marketing, SEO, QA software testing, and other roles offer exciting opportunities for non-technical professionals to thrive. By leveraging their unique skills, individuals can contribute significantly to the success and innovation within the dynamic tech landscape. Don't let the "non-technical" label hold you back – there's a place for everyone in the tech industry.&lt;/p&gt;

&lt;h2&gt;
  
  
  FINAL WORD: YOUR ADVENTURE BEGINS NOW!
&lt;/h2&gt;

&lt;p&gt;Jumping into the tech world might seem like a big deal, but it's so worth it. Face the challenges, celebrate your wins, and step into a world where amazing things can happen. &lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>A Beginner's Guide to Starting a Career in Web Development</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Thu, 25 Jan 2024 09:16:39 +0000</pubDate>
      <link>https://dev.to/prameshkc/a-beginners-guide-to-starting-a-career-in-web-development-3o8p</link>
      <guid>https://dev.to/prameshkc/a-beginners-guide-to-starting-a-career-in-web-development-3o8p</guid>
      <description>&lt;p&gt;Welcome to the wonderful world of web development! Whether you're interested in a career change, want to improve your skills, or simply explore a new passion, this guide is designed with you in mind. I'll explain the fundamentals of web development in a simple and easy-to-understand manner, helping you embark on this fulfilling journey.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Web Development?
&lt;/h1&gt;

&lt;p&gt;Web development is like building and maintaining houses, but in the online world. It involves a mix of creativity, problem-solving, and a pinch of magic to craft websites. There are two main areas:&lt;/p&gt;

&lt;h2&gt;
  
  
  Frontend Development
&lt;/h2&gt;

&lt;p&gt;Think of frontend developers as the architects and interior designers. They make sure the website looks good and feels easy to use. They use languages like HTML (the structure), CSS (the style), and JavaScript (the interactivity) to create what you see on a webpage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backend Development
&lt;/h2&gt;

&lt;p&gt;Backend developer is like a chef in a restaurant. Just as a chef prepares your food in the kitchen (which you can’t see), a backend developer works on the parts of a website or app that you can’t see. They write code that helps the website or app to function correctly.They use languages such as Python, C#, Ruby to handle data, user authentication, and overall functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.Explore Basic Concepts
&lt;/h3&gt;

&lt;h4&gt;
  
  
  a. HTML (Hypertext Markup Language)
&lt;/h4&gt;

&lt;p&gt;Understand the structure of a webpage using HTML. It's like the skeleton of a website, defining headings, paragraphs, images, and links.&lt;/p&gt;

&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;My First Webpage&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Welcome to My Webpage&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;This is a simple paragraph on my webpage.&amp;lt;/p&amp;gt;
    &amp;lt;img src="image.jpg" alt="A beautiful image"&amp;gt;
    &amp;lt;a href="https://www.example.com"&amp;gt;Visit Example.com&amp;lt;/a&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;: Think of it as the start of your document.
&amp;lt;head&amp;gt; Contains important info about your webpage.
&amp;lt;body&amp;gt;: Where your content goes - like text and images.
&amp;lt;h1&amp;gt;: The biggest heading.
&amp;lt;p&amp;gt;: A paragraph of text.
&amp;lt;img&amp;gt;: An image.
&amp;lt;a&amp;gt;: A link to another webpage.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  b. CSS (Cascading Style Sheets)
&lt;/h4&gt;

&lt;p&gt;Learn how to style your HTML elements with CSS. This includes choosing colors, setting fonts, and positioning elements to create an attractive layout.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
    background-color: #f0f0f0;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

h1 {
    color: #008080;
}

p {
    font-size: 18px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body: Styles the whole webpage.
background-color: Changes the background color.
text-align: Centers the text.
font-family: Chooses the font style.
h1: Styles the main heading.
color: Picks the text color.
p: Styles the paragraph.
font-size: Sets the text size.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  c. JavaScript
&lt;/h4&gt;

&lt;p&gt;JavaScript is the wizard behind the curtain. It makes your website interactive – from simple animations to handling what happens when you click a button. It allows you to add functionality, create dynamic content, and respond to user actions.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Interactive Webpage&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1 id="demo"&amp;gt;Click the Button!&amp;lt;/h1&amp;gt;
    &amp;lt;button onclick="changeText()"&amp;gt;Click Me&amp;lt;/button&amp;gt;

    &amp;lt;script&amp;gt;
        function changeText() {
            document.getElementById('demo').innerHTML = 'Button Clicked!';
        }
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onclick="changeText()": A button that does something when clicked.
document.getElementById('demo').innerHTML: Finds the part of the webpage and changes its content.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Choose Your Development Environment, your playground
&lt;/h3&gt;

&lt;p&gt;Set up a code editor like Visual Studio Code, notepad++, it's like a digital notebook for your code. Explore web browsers like Chrome or Firefox. Familiarize yourself with developer tools to inspect and debug your code.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Online Learning Platforms
&lt;/h3&gt;

&lt;p&gt;Take advantage of online learning platforms like Codecademy, freeCodeCamp, Udacity. These platforms offer interactive courses that guide you through the basics of web development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Your First Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.Start with Baby Steps, Start Small
&lt;/h3&gt;

&lt;p&gt;Create a simple webpage with HTML and CSS. This could be your online resume, a personal blog, or a portfolio to showcase your work.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add Interactivity
&lt;/h3&gt;

&lt;p&gt;Enhance your webpage using JavaScript. Start with basic interactions like form validation or a responsive navigation menu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expanding Your Knowledge
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Dive Deeper into Frontend or Backend
&lt;/h3&gt;

&lt;p&gt;Based on your interests, explore more advanced topics in frontend or backend development. This could include frameworks like React or Angular for frontend, or C#,Python for backend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building Your Portfolio
&lt;/h3&gt;

&lt;p&gt;Create a portfolio website to showcase the projects you've worked on. This will serve as a tangible representation of your skills for potential employers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overcoming Doubts and Embracing Learning
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Embracing Mistakes&lt;/strong&gt;:&lt;br&gt;
Every expert was once a beginner. Don't worry about making mistakes—they help you learn. It's okay to start small and get better step by step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning Made Fun&lt;/strong&gt;:&lt;br&gt;
Websites like Codecademy and freeCodeCamp turn learning into a game. Web development isn't boring; it's an exciting journey where you discover new things and have fun along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've taken the first steps into the exciting world of web development. Remember, it's okay to start small, make mistakes, and learn as you go. Your journey is uniquely yours, and every line of code is a step forward. So, embrace the adventure, build, create, and let your passion for web development propel you into a fulfilling and rewarding career. The digital world awaits your creativity!&lt;/p&gt;

&lt;p&gt;By: &lt;a class="mentioned-user" href="https://dev.to/prameshkc"&gt;@prameshkc&lt;/a&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Handling Non-Standard JSON in .NET Using System.Text.Json</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Thu, 04 Jan 2024 09:23:27 +0000</pubDate>
      <link>https://dev.to/prameshkc/handling-non-standard-json-in-net-using-systemtextjson-3e97</link>
      <guid>https://dev.to/prameshkc/handling-non-standard-json-in-net-using-systemtextjson-3e97</guid>
      <description>&lt;p&gt;JSON (JavaScript Object Notation) is a widely used data format for exchanging information between applications and systems. While JSON has a well-defined specification, real-world JSON data sometimes includes non-standard additions such as comments, trailing commas, or encoded numbers.&lt;/p&gt;

&lt;p&gt;The .NET library System.Text.Json offers efficient JSON serialization and deserialization. By default, it strictly adheres to the JSON specification. However, System.Text.Json also provides options to process non-standard JSON content.&lt;/p&gt;

&lt;p&gt;In this article, we will explore how to configure System.Text.Json to handle JSON data that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comments&lt;/li&gt;
&lt;li&gt;Trailing commas&lt;/li&gt;
&lt;li&gt;Number Handling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Allowing Comments in JSON
&lt;/h2&gt;

&lt;p&gt;Comments are not permitted in valid JSON. However, we may encounter JSON strings with comments for documentation purposes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JSON:
{
  "name": "PrameshKc", // name of the user
  "age": 30
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;br&gt;
&lt;code&gt;System.Text.Json.JsonException: '/' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To allow comments when deserializing, we need to set the &lt;code&gt;JsonSerializerOptions.ReadCommentHandling&lt;/code&gt; property:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  ReadCommentHandling = JsonCommentHandling.Skip
};


var data = JsonSerializer.Deserialize&amp;lt;User&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will skip over any comments in the JSON string during deserialization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ignoring Trailing Commas
&lt;/h2&gt;

&lt;p&gt;Trailing commas are also invalid in JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JSON:
{
  "name": "PrameshKc",
  "age": 30,
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;br&gt;
&lt;code&gt;System.Text.Json.JsonException: The JSON object contains a trailing comma at the end which is not supported in this mode.&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
To permit trailing commas, set JsonSerializerOptions.AllowTrailingCommas to true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  AllowTrailingCommas = true  
};

var data = JsonSerializer.Deserialize&amp;lt;Data&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now any trailing commas will be ignored when deserializing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing Number Handling
&lt;/h2&gt;

&lt;p&gt;Sometimes JSON may encode numbers as strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;json
{
  "temp": "37" 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;System.Text.Json.JsonException: 'The JSON value could not be converted to System.Int32. Path: $.DegreesCelsius | LineNumber: 2 | BytePositionInLine: 21.'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can customize how numbers are handled using the JsonNumberHandling option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  NumberHandling = JsonNumberHandling.AllowReadingFromString
};

var data = JsonSerializer.Deserialize&amp;lt;Weather&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will permit deserializing string-encoded numbers to numeric properties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The System.Text.Json API provides many options to handle non-standard JSON formatting like comments, trailing commas, and unquoted names. By configuring JsonSerializerOptions, we can customize how .NET handles invalid JSON data during serialization and deserialization.&lt;br&gt;
Happy coding! 😊&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/prameshkc/"&gt;@prameshkc &lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>microsoft</category>
      <category>azure</category>
    </item>
    <item>
      <title>Handling Non-Standard JSON in .NET Using System.Text.Json</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Thu, 04 Jan 2024 08:24:36 +0000</pubDate>
      <link>https://dev.to/prameshkc/handling-non-standard-json-in-net-using-systemtextjson-451d</link>
      <guid>https://dev.to/prameshkc/handling-non-standard-json-in-net-using-systemtextjson-451d</guid>
      <description>&lt;p&gt;JSON (JavaScript Object Notation) is a widely used data format for exchanging information between applications and systems. While JSON has a well-defined specification, real-world JSON data sometimes includes non-standard additions such as comments, trailing commas, or encoded numbers.&lt;/p&gt;

&lt;p&gt;The .NET library System.Text.Json offers efficient JSON serialization and deserialization. By default, it strictly adheres to the JSON specification. However, System.Text.Json also provides options to process non-standard JSON content.&lt;/p&gt;

&lt;p&gt;In this article, we will explore how to configure System.Text.Json to handle JSON data that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comments&lt;/li&gt;
&lt;li&gt;Trailing commas&lt;/li&gt;
&lt;li&gt;Number Handling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Allowing Comments in JSON
&lt;/h2&gt;

&lt;p&gt;Comments are not permitted in valid JSON. However, we may encounter JSON strings with comments for documentation purposes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JSON:
{
  "name": "PrameshKc", // name of the user
  "age": 30
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;br&gt;
&lt;code&gt;System.Text.Json.JsonException: '/' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To allow comments when deserializing, we need to set the &lt;code&gt;JsonSerializerOptions.ReadCommentHandling&lt;/code&gt; property:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  ReadCommentHandling = JsonCommentHandling.Skip
};


var data = JsonSerializer.Deserialize&amp;lt;User&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will skip over any comments in the JSON string during deserialization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ignoring Trailing Commas
&lt;/h2&gt;

&lt;p&gt;Trailing commas are also invalid in JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JSON:
{
  "name": "PrameshKc",
  "age": 30,
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;br&gt;
&lt;code&gt;System.Text.Json.JsonException: The JSON object contains a trailing comma at the end which is not supported in this mode.&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
To permit trailing commas, set JsonSerializerOptions.AllowTrailingCommas to true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  AllowTrailingCommas = true  
};

var data = JsonSerializer.Deserialize&amp;lt;Data&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now any trailing commas will be ignored when deserializing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing Number Handling
&lt;/h2&gt;

&lt;p&gt;Sometimes JSON may encode numbers as strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;json
{
  "temp": "37" 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we try to deserialize the above JSON, we will get the following exception:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;System.Text.Json.JsonException: 'The JSON value could not be converted to System.Int32. Path: $.DegreesCelsius | LineNumber: 2 | BytePositionInLine: 21.'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can customize how numbers are handled using the JsonNumberHandling option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var options = new JsonSerializerOptions
{
  NumberHandling = JsonNumberHandling.AllowReadingFromString
};

var data = JsonSerializer.Deserialize&amp;lt;Weather&amp;gt;(json, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will permit deserializing string-encoded numbers to numeric properties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The System.Text.Json API provides many options to handle non-standard JSON formatting like comments, trailing commas, and unquoted names. By configuring JsonSerializerOptions, we can customize how .NET handles invalid JSON data during serialization and deserialization.&lt;br&gt;
Happy coding! 😊&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/prameshkc/"&gt;@prameshkc &lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Discovering the Gem in .NET 8: Introducing ".NET Aspire"</title>
      <dc:creator>Pramesh Kc.</dc:creator>
      <pubDate>Mon, 18 Dec 2023 10:54:43 +0000</pubDate>
      <link>https://dev.to/prameshkc/discovering-the-gem-in-net-8-introducing-net-aspire-1mlo</link>
      <guid>https://dev.to/prameshkc/discovering-the-gem-in-net-8-introducing-net-aspire-1mlo</guid>
      <description>&lt;p&gt;This year, Microsoft rolled out a game-changer in the .NET 8 lineup – ".NET Aspire." As a developer, this has quickly become my absolute favorite feature. &lt;/p&gt;

&lt;p&gt;We'll delve into the essentials of ".NET Aspire" and walk through the installation steps to get it up and running on your development environment. From there, we'll fire up a new project, leveraging the power and flexibility that ".NET Aspire" brings to the table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finos24xhiekn7a2n0txe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finos24xhiekn7a2n0txe.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;What is .net Aspire?&lt;/strong&gt;&lt;br&gt;
Imagine a toolkit designed specifically for crafting cloud-ready, distributed applications. That's exactly what .NET Aspire brings to the table. It's not just a set of tools; it's a cloud-native stack delivered through NuGet packages, addressing key concerns in modern application development.&lt;/p&gt;

&lt;p&gt;The beauty of .NET Aspire lies in its compatibility with the microservices approach. If you're into building applications with smaller, interconnected components, this is your golden ticket. Cloud-native apps, leveraging .NET Aspire, seamlessly consume various services like databases, messaging, and caching.&lt;/p&gt;

&lt;p&gt;**Before we dive into the world of ".NET Aspire," let's make sure you're all set. Here's your checklist:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.NET 8 Installed&lt;/strong&gt;: It's like the superhero suit for your development adventures. Make sure you have .NET 8 ready to roll on your machine.&lt;/p&gt;

&lt;p&gt;.&lt;strong&gt;NET Aspire Workload&lt;/strong&gt;: &lt;br&gt;
 CLI to install .net aspire&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet workload update
// to make sure latest .net aspire installed


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet workload install aspire
//This brings all the magic to your development world.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet workload list
//check current aspire version


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;IDE or Code Editor&lt;/strong&gt;: Choose your weapon! While it's optional, having a good Integrated Developer Environment (IDE) or code editor enhances the experience. You can go with Visual Studio 2022 Preview version 17.9 or higher for the full superhero vibe. If you're more of a minimalist, Visual Studio Code works like a charm too.&lt;br&gt;
&lt;strong&gt;Docker Desktop:&lt;/strong&gt;&lt;br&gt;
For that extra oomph in containerized magic, grab "Docker Desktop."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Launching Your First .NET Aspire Project: Easy-Peasy Steps&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;Ready to dip your toes into the world of ".NET Aspire"? Let's create your very own project with these simple commands:&lt;/p&gt;

&lt;p&gt;Basic .NET Aspire Project:&lt;br&gt;
If you're starting fresh, use this magic line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet new aspire --name dotnet8Aspire



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This sets up a basic ".NET Aspire" project for you – like a blank canvas waiting for your code masterpiece.&lt;/p&gt;

&lt;p&gt;Fancy .NET Aspire Project (with UI and API):&lt;br&gt;
Feeling a bit adventurous? Try this one:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

dotnet new aspire-starter


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This not only creates a ".NET Aspire" project but also throws in a sample UI and API.&lt;/p&gt;

&lt;p&gt;I'm creating basic .net aspire project with out UI and API, I'll add project later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhdj3l6ly86auu2f4cw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhdj3l6ly86auu2f4cw8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the simple command dotnet new aspire, you're getting a no-frills ".NET Aspire" app. What's inside? Just two main things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AppHost&lt;/strong&gt;: The Maestro of Your App&lt;br&gt;
The AppHost is like the chief conductor of your app orchestra. It rounds up all your projects, builds them, and sets the stage for your application. Imagine it as the leader making sure everyone plays in harmony. As you add more projects, AppHost takes care of the coordination, handling dependencies, NuGet files, and resolving connections – making your life easier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljlf0inxv7xdp2egunev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljlf0inxv7xdp2egunev.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ServiceDefaults&lt;/strong&gt;: The Powerhouse of Aspire&lt;br&gt;
Meet ServiceDefaults the powerhouse of Aspire. It's like a pre-loaded magic box for your app. Telemetry, logging, metrics, analytics – it's all set up without you lifting a finger. Microsoft gives you a default set of tools, but hey, feel free to tweak, add, or remove as you please. It's your app, your rules! 🎉💻✨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly7443mgxcgbmmfdfgqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly7443mgxcgbmmfdfgqf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's run the project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu14v943k0uys0ivaqesp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu14v943k0uys0ivaqesp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;running on port &lt;a href="http://localhost:18888" rel="noopener noreferrer"&gt;http://localhost:18888&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hnjzqbmeqm47fo40l6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hnjzqbmeqm47fo40l6c.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dasboard for .net aspire simple project. Since we've added any project so it's saying no project found on project list.&lt;br&gt;
Lets add simple API project on this aspire project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngzm2ftj2f12xf0fwnqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngzm2ftj2f12xf0fwnqb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4046u4bgz6tmor31nbm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4046u4bgz6tmor31nbm1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've created a simple asp.net core web api project with name dotnet8Aspire.API&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gz9xvdj6q5nc5y15f1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gz9xvdj6q5nc5y15f1w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's add API project to aspire. Since i've not install vs tools for visual studio through which we can enable aspire support for projects with Visual studio with just couple of click. So I'll manually add project to aspire.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdv9lwjjqt6kx5d4z2iw7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdv9lwjjqt6kx5d4z2iw7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API project reference is added on aspire project , now let's configure on appHost program.cs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3qrbpfk83gvz3pb748e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3qrbpfk83gvz3pb748e.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we add reference of other projects on aspire , all the added projects will available inside namespace "&lt;strong&gt;projects&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;On API project "dotnet8Aspire.API" add reference of ServiceDefaults project and register AddServiceDefault on program.cs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foip8bv8rr5ybgomaqyd0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foip8bv8rr5ybgomaqyd0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now Lets run the project again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6hpi9882d7qur14gesd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6hpi9882d7qur14gesd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as we can see there's our newly added project on dashbaord. We can run the projects from here, view logs, enviroment variables and so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxnf00zy7k6zmuxiiv23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxnf00zy7k6zmuxiiv23.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API project is running on &lt;a href="http://localhost:5244" rel="noopener noreferrer"&gt;http://localhost:5244&lt;/a&gt;. By regsitering on AppHost (aspire) we don't have to manually run API project, all the things are taken care from appHost.&lt;/p&gt;

&lt;p&gt;let's send request from API and see logs from dashboard &lt;a href="http://localhost:5244" rel="noopener noreferrer"&gt;http://localhost:5244&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgyveigqo0ppu88rka1yi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgyveigqo0ppu88rka1yi.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've execute one endpoint of API , now let's see on dashboard if there's any logs available from this current request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favh4vika0je05z20mjpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favh4vika0je05z20mjpg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it – a simple sneak peek into the world of ".NET Aspire." This was just the tip of the iceberg, a basic intro to get your feet wet. I hope you found it helpful and maybe learned a thing or two.&lt;br&gt;
 There's so much more to explore in the realm of .NET Aspire. So buckle up, stay curious, and keep an eye out for the next tutorial where we'll dive even deeper into the wonders of .NET Aspire. Until then, happy coding, and may your apps aspire to greatness! 💻🚀🌟&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>dotnet8</category>
      <category>cloudnative</category>
      <category>newfeature</category>
    </item>
  </channel>
</rss>
