<?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>Forem: Arash zandi</title>
    <description>The latest articles on Forem by Arash zandi (@arashzandi).</description>
    <link>https://forem.com/arashzandi</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%2F1091772%2F5f861314-2b80-4c31-a6a9-bc13f89efa76.jpg</url>
      <title>Forem: Arash zandi</title>
      <link>https://forem.com/arashzandi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/arashzandi"/>
    <language>en</language>
    <item>
      <title>C# win Tiobe Programming Language of the Year 2025🚀</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Wed, 07 Jan 2026 06:23:59 +0000</pubDate>
      <link>https://forem.com/arashzandi/c-win-tiobe-programming-language-of-the-year-2025-3ppo</link>
      <guid>https://forem.com/arashzandi/c-win-tiobe-programming-language-of-the-year-2025-3ppo</guid>
      <description>&lt;p&gt;&lt;strong&gt;C# saw the largest increase in ranking in the index year over year, while Java held steady, C and C++ swapped positions, R and Perl rose, and Go and Ruby faded, Python slipped slightly year over year.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the second time in three years, C# has been named Programming Language of the Year by the TIOBE Index. C# earned this distinction by achieving the largest year-over-year increase in ranking. Over the years, the language has undergone fundamental changes. From a language-design perspective, C# has often been an early adopter of new trends among mainstream languages. At the same time, it successfully made two major paradigm shifts: from Windows-only to cross-platform, and from Microsoft-owned to open source. C# has consistently evolved at the right moment.&lt;/p&gt;

&lt;p&gt;More information : &lt;a href="https://www.tiobe.com/tiobe-index/" rel="noopener noreferrer"&gt;TIOBE Index - TIOBE&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>📱 Is Windows 11 ARM Coming to Phones ?</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Tue, 30 Sep 2025 06:38:15 +0000</pubDate>
      <link>https://forem.com/arashzandi/is-windows-11-arm-coming-to-phones--gg0</link>
      <guid>https://forem.com/arashzandi/is-windows-11-arm-coming-to-phones--gg0</guid>
      <description>&lt;p&gt;Microsoft is indeed investing heavily in Windows 11 on ARM, but not for smartphones or small mobile devices—at least not yet. Here's the current landscape and what the UI evolution might suggest:&lt;/p&gt;

&lt;h2&gt;
  
  
  📱 Is Windows 11 ARM Coming to Phones?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- No official plans for smartphones:&lt;/strong&gt; Microsoft has not announced any intention to bring Windows 11 ARM to mobile phones. The focus remains on laptops, tablets, and hybrid devices powered by ARM chips like Qualcomm's Snapdragon X Elite.&lt;br&gt;
&lt;strong&gt;- Cellular-ready ARM PCs:&lt;/strong&gt; Many ARM-based Windows devices support cellular connectivity, instant-on behavior, and long battery life—traits borrowed from mobile phones. But these are still full PCs, not pocket-sized devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Why the UI Is Becoming Touch-Friendly
&lt;/h2&gt;

&lt;p&gt;You're absolutely right—Windows 11's UI is increasingly:&lt;br&gt;
&lt;strong&gt;- Responsive:&lt;/strong&gt; Adapts to screen sizes and orientations.&lt;br&gt;
&lt;strong&gt;- Touch-optimized:&lt;/strong&gt; Larger hit targets, gesture support, and fluid animations.&lt;br&gt;
&lt;strong&gt;- Stylus-aware:&lt;/strong&gt; Better inking and handwriting recognition.&lt;br&gt;
This is not accidental. Microsoft is preparing Windows to run seamlessly across a spectrum of form factors, from foldables to tablets to dual-screen devices. Think Surface Pro, Surface Duo (Android), and future ARM laptops—not traditional smartphones.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔮 What Could Happen Next?
&lt;/h2&gt;

&lt;p&gt;While there's no direct plan for Windows 11 on phones, the groundwork is being laid for:&lt;br&gt;
&lt;strong&gt;- More compact ARM devices:&lt;/strong&gt; Possibly foldables or ultra-portables with full Windows.&lt;br&gt;
&lt;strong&gt;- Copilot+ PCs:&lt;/strong&gt; AI-powered ARM laptops with mobile-like responsiveness and battery life.&lt;br&gt;
&lt;strong&gt;- Unified design language:&lt;/strong&gt; Fluent UI and WinUI 3 make it easier to scale across device types—something you're already leveraging in your own WinUI3 work.&lt;/p&gt;

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

&lt;p&gt;So yes, the UI evolution is a clue—but not toward phones. It's about bridging the gap between mobile and desktop experiences, especially in the ARM ecosystem. If Microsoft ever does re-enter the phone space with Windows, it’ll likely be through a dual-screen or foldable device, not a traditional smartphone.&lt;/p&gt;

</description>
      <category>microsoft</category>
      <category>mobile</category>
      <category>news</category>
    </item>
    <item>
      <title>.NET Run C# Single Files Without a Project — Almost Like Python</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Fri, 22 Aug 2025 13:20:14 +0000</pubDate>
      <link>https://forem.com/arashzandi/net-run-c-single-files-without-a-project-almost-like-python-2o3e</link>
      <guid>https://forem.com/arashzandi/net-run-c-single-files-without-a-project-almost-like-python-2o3e</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;.NET platform&lt;/strong&gt; is Microsoft’s cross-platform, open-source runtime and SDK for building applications that run from tiny IoT devices to large cloud services. Its primary language, C#, compiles to efficient native code and offers modern features for productivity and safety. Historically, developers began with a project &lt;code&gt;(.csproj)&lt;/code&gt; and solution structure; the &lt;strong&gt;.NET CLI&lt;/strong&gt; &lt;code&gt;(dotnet)&lt;/code&gt; then built and ran that project. Starting with &lt;strong&gt;C# 14 / .NET 10&lt;/strong&gt;, you can also run a &lt;em&gt;single C# source file&lt;/em&gt; directly—an approach called a &lt;strong&gt;file-based&lt;/strong&gt; app—and in .NET 10 that experience received major upgrades. &lt;br&gt;
This article introduces the file-based model, explains the &lt;strong&gt;.NET 10&lt;/strong&gt; enhancements (notably native AOT publishing), and walks through step-by-step examples you can try today.&lt;/p&gt;

&lt;p&gt;I'll show you step by step : &lt;/p&gt;

&lt;p&gt;1 . First download .Net SDK &lt;strong&gt;SDK 10.0.100-preview.4&lt;/strong&gt; or newer from this link :&lt;br&gt;
&lt;a href="https://dotnet.microsoft.com/en-us/download/dotnet/10.0" rel="noopener noreferrer"&gt;Download .NET 10.0&lt;/a&gt; and install it&lt;/p&gt;

&lt;p&gt;2 . Create a folder in your machine and then create a Program.cs file inside the folder. &lt;em&gt;(you can now create and run any .cs file and the name not matters)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;3 . Write this code in &lt;strong&gt;Program.cs&lt;/strong&gt;&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="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4 .  then open the folder containing &lt;strong&gt;Program.cs&lt;/strong&gt; file in the &lt;strong&gt;terminal , CMD or even VsCode Terminal&lt;/strong&gt; and run this command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Dotnet run Program.cs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;5 .  Finish... This is your result :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F2gsvs5zrtcw9e1vhio3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2gsvs5zrtcw9e1vhio3f.png" alt="Result of running" width="474" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Now let's have more details :
&lt;/h2&gt;

&lt;h3&gt;
  
  
  using nuget packages
&lt;/h3&gt;

&lt;p&gt;Suppose that you want to use a nuget package in your app like &lt;strong&gt;Newtonsoft.Json&lt;/strong&gt; and use it in your codes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add this line in top of your .cs file :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;Newtonsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="m"&gt;13.0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or for using latest version&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="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;Newtonsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="p"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then write the &lt;strong&gt;using&lt;/strong&gt; :
&lt;/li&gt;
&lt;/ul&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;Newtonsoft.Json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now You can use the &lt;strong&gt;Newtonsoft.Json&lt;/strong&gt; in your project and this is my sample :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;Newtonsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="m"&gt;13.0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Newtonsoft.Json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&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;date&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="n"&gt;date&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a test message"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;jsonString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SerializeObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Formatting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Indented&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jsonString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the result is something like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;PS&lt;/span&gt; &lt;span class="nf"&gt;C:\Users\ArashZandi\Desktop\C#&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;dotnet&lt;/span&gt; &lt;span class="nb"&gt;run&lt;/span&gt; &lt;span class="nf"&gt;program.cs&lt;/span&gt;
&lt;span class="nf"&gt;Hello,&lt;/span&gt; &lt;span class="nf"&gt;World!&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;"date":&lt;/span&gt; &lt;span class="nf"&gt;"2025-08-22T15:16:44.4952004+03:30",&lt;/span&gt;
  &lt;span class="nf"&gt;"message":&lt;/span&gt; &lt;span class="nf"&gt;"This&lt;/span&gt; &lt;span class="nf"&gt;is&lt;/span&gt; &lt;span class="nf"&gt;a&lt;/span&gt; &lt;span class="nf"&gt;test&lt;/span&gt; &lt;span class="nf"&gt;message"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Making an API with just a single file
&lt;/h2&gt;

&lt;p&gt;1 . Make a file with your desired name (mine is Api.cs)&lt;br&gt;
2 . Write this codes :&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="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;sdk&lt;/span&gt; &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Web&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RunAsync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 . Now run the project with the command &lt;code&gt;Dotnet run Api.cs&lt;/code&gt;&lt;br&gt;
4 . The result is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;PS&lt;/span&gt; &lt;span class="nf"&gt;C:\Users\ArashZandi\Desktop\C#&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;dotnet&lt;/span&gt; &lt;span class="nb"&gt;run&lt;/span&gt; &lt;span class="nf"&gt;api.cs&lt;/span&gt;
&lt;span class="nf"&gt;info:&lt;/span&gt; &lt;span class="nf"&gt;Microsoft.Hosting.Lifetime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nf"&gt;Now&lt;/span&gt; &lt;span class="nf"&gt;listening&lt;/span&gt; &lt;span class="nf"&gt;on:&lt;/span&gt; &lt;span class="nf"&gt;http:&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;/localhost:5000&lt;/span&gt;
&lt;span class="nf"&gt;info:&lt;/span&gt; &lt;span class="nf"&gt;Microsoft.Hosting.Lifetime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nf"&gt;Application&lt;/span&gt; &lt;span class="nf"&gt;started.&lt;/span&gt; &lt;span class="nf"&gt;Press&lt;/span&gt; &lt;span class="nf"&gt;Ctrl+C&lt;/span&gt; &lt;span class="nf"&gt;to&lt;/span&gt; &lt;span class="nf"&gt;shut&lt;/span&gt; &lt;span class="nf"&gt;down.&lt;/span&gt;
&lt;span class="nf"&gt;info:&lt;/span&gt; &lt;span class="nf"&gt;Microsoft.Hosting.Lifetime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nf"&gt;Hosting&lt;/span&gt; &lt;span class="nf"&gt;environment:&lt;/span&gt; &lt;span class="nf"&gt;Production&lt;/span&gt;
&lt;span class="nf"&gt;info:&lt;/span&gt; &lt;span class="nf"&gt;Microsoft.Hosting.Lifetime&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nf"&gt;Content&lt;/span&gt; &lt;span class="nf"&gt;root&lt;/span&gt; &lt;span class="nf"&gt;path:&lt;/span&gt; &lt;span class="nf"&gt;C:\Users\ArashZandi\Desktop\C#&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5 . You see that there is a website listening this address &lt;code&gt;http://localhost:5000&lt;/code&gt; Now in your browser go to this link&lt;br&gt;
&lt;a href="http://localhost:5000/test" rel="noopener noreferrer"&gt;http://localhost:5000/test&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6 . You should see the &lt;code&gt;Hello World!&lt;/code&gt; comming from the API (read about Minimal Apis more in the references) as the result.&lt;/p&gt;

&lt;p&gt;Tip : the key point of this type of .cs file is this line &lt;code&gt;#:sdk Microsoft.Net.Sdk.Web&lt;/code&gt; which allow you to use &lt;code&gt;WebApplication&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Converting the .cs file to a .csproj based project
&lt;/h2&gt;

&lt;p&gt;You can convert your .cs file to the other type which uses .csproj file like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="kd"&gt;dotnet&lt;/span&gt; &lt;span class="kd"&gt;project&lt;/span&gt; &lt;span class="nb"&gt;convert&lt;/span&gt; &lt;span class="kd"&gt;program&lt;/span&gt;.cs
&lt;span class="kd"&gt;dotnet&lt;/span&gt; &lt;span class="kd"&gt;project&lt;/span&gt; &lt;span class="nb"&gt;convert&lt;/span&gt; &lt;span class="kd"&gt;api&lt;/span&gt;.cs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I've converted my projects one by one in their own folders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Referencing to your other projects in the .cs file
&lt;/h2&gt;

&lt;p&gt;My Program.cs and Api.cs were in a same folder, I've converted them and I have this file/folder tree&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fekk590nv6n5e346z8l2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fekk590nv6n5e346z8l2c.png" alt="File/Folder tree" width="269" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I want to use my &lt;code&gt;Program.csproj&lt;/code&gt; in the &lt;code&gt;Api.cs&lt;/code&gt; (single file)&lt;br&gt;
Actually I want to have a reference of &lt;code&gt;Program.csproj&lt;/code&gt; (the converted proj) into &lt;code&gt;Api.cs&lt;/code&gt; (the single file project)&lt;/p&gt;

&lt;p&gt;1 . I delete converted &lt;code&gt;Program.cs&lt;/code&gt; project and modify my &lt;code&gt;program.cs&lt;/code&gt; file like this :&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="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;Newtonsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Json&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="m"&gt;13.0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Newtonsoft.Json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&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;date&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="n"&gt;date&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a test message"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;jsonString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SerializeObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Formatting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Indented&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jsonString&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;ProgramTestClass&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="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"This is a test method."&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;p&gt;I convert it again to a &lt;code&gt;.csproj&lt;/code&gt; project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="kd"&gt;dotnet&lt;/span&gt; &lt;span class="kd"&gt;project&lt;/span&gt; &lt;span class="nb"&gt;convert&lt;/span&gt; &lt;span class="kd"&gt;program&lt;/span&gt;.cs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in my &lt;code&gt;Api.cs&lt;/code&gt; file I can use this line&lt;br&gt;
&lt;code&gt;#:project ./program/program.csproj&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And my codes in &lt;code&gt;Api.cs&lt;/code&gt; are these :&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="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;sdk&lt;/span&gt; &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Web&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="p"&gt;./&lt;/span&gt;&lt;span class="n"&gt;program&lt;/span&gt;&lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="n"&gt;program&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csproj&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&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;stringFromReferencedProj&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ProgramTestClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;stringFromReferencedProj&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RunAsync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of this link&lt;br&gt;
&lt;a href="http://localhost:5000/test" rel="noopener noreferrer"&gt;http://localhost:5000/test&lt;/a&gt;&lt;br&gt;
is : &lt;br&gt;
&lt;code&gt;This is a test method.&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When to choose file-based apps (and when not)
&lt;/h2&gt;

&lt;p&gt;File-based apps shine for small CLI tools, teaching, experiments, or build scripts—situations where you want to get from idea to running code with minimal ceremony. As complexity grows (multiple files, tests, multi-targeting, analyzers), migrate to a traditional project structure. The official tutorial and ecosystem write-ups emphasize this pragmatic split&lt;/p&gt;

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

&lt;p&gt;.NET 10 turns file-based apps from a neat trick into a &lt;strong&gt;capable development mode&lt;/strong&gt;. You can run C# files directly, pull in NuGet packages and other projects with declarative #: directives, publish native executables by default, and even host a minimal web API in a single file. The result is a lower-ceremony on-ramp to C# that still scales into project-based development when your program outgrows one file&lt;/p&gt;

&lt;h2&gt;
  
  
  References to read more :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/overview" rel="noopener noreferrer"&gt;Microsoft Learn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/overview#file-based-apps" rel="noopener noreferrer"&gt;A tour of the C# language&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/overview" rel="noopener noreferrer"&gt;What's new in .NET 10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Announcing dotnet run app.cs – A simpler way to start with C# and .NET 10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-10.0&amp;amp;tabs=visual-studio" rel="noopener noreferrer"&gt;Tutorial: Create a minimal API with ASP.NET Core&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>dotnet</category>
      <category>csharp</category>
    </item>
    <item>
      <title>.Net Aspire - Add Swagger, OpenApi, Scalar to the AppHost</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Mon, 03 Mar 2025 12:50:52 +0000</pubDate>
      <link>https://forem.com/arashzandi/net-aspire-add-swagger-openapi-scalar-to-the-apphost-3ll6</link>
      <guid>https://forem.com/arashzandi/net-aspire-add-swagger-openapi-scalar-to-the-apphost-3ll6</guid>
      <description>&lt;p&gt;Before you begin, If you are not familar with OpenApi, Swagger or Scalar please read this article :&lt;br&gt;
&lt;a href="https://dev.to/arashzandi/net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar-527"&gt;net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can have &lt;strong&gt;ApiDocs&lt;/strong&gt; and also &lt;strong&gt;your custom links&lt;/strong&gt; in your .Net &lt;strong&gt;Aspire&lt;/strong&gt; Dashboard like this :&lt;br&gt;
&lt;a href="https://media2.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%2Ffrcgmib9f7kbpe58jg74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffrcgmib9f7kbpe58jg74.png" alt=".Net Aspire - Swagger" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simply install this nuget package &lt;code&gt;Arshid.Aspire.ApiDocs.Extensions&lt;/code&gt; to your &lt;strong&gt;AppHost.csproj&lt;/strong&gt;&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 Arshid.Aspire.ApiDocs.Extensions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add these lines for the project that has Swagger, Scalar or etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  📦 Example
&lt;/h2&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;Arshid.Aspire.ApiDocs.Extensions&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;apiService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddProject&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AspireApp1_ApiService&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;"apiservice"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithScalar&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithSwagger&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithOpenApi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithCustomUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://127.0.0.1:5000/CustomRoute/CustomPage1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/CustomRoute/CustomPage2"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//The URL become something like this {protocol}://{url}:{port}/CustomRoute/CustomPage2&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Source Codes are available here in &lt;strong&gt;GitHub&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://github.com/zandiarash/Arshid-Aspire-ApiDocs-Extensions" rel="noopener noreferrer"&gt;https://github.com/zandiarash/Arshid-Aspire-ApiDocs-Extensions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nuget Package:&lt;br&gt;
&lt;a href="https://www.nuget.org/packages/Arshid.Aspire.ApiDocs.Extensions" rel="noopener noreferrer"&gt;Arshid.Aspire.ApiDocs.Extensions&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Blazor: A Comprehensive Introduction, Pros and Cons, and Comparison with Angular, React, and Vue</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Wed, 15 Jan 2025 09:29:56 +0000</pubDate>
      <link>https://forem.com/arashzandi/blazor-a-comprehensive-introduction-pros-and-cons-and-comparison-with-angular-react-and-vue-2bhb</link>
      <guid>https://forem.com/arashzandi/blazor-a-comprehensive-introduction-pros-and-cons-and-comparison-with-angular-react-and-vue-2bhb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Microsoft Blazor: Revolutionizing Web Development with .NET&lt;/strong&gt;&lt;br&gt;
Microsoft Blazor is a cutting-edge web framework that has been making waves in the web development community. As part of the .NET ecosystem, Blazor enables developers to build interactive and dynamic web applications using C# and .NET instead of relying on JavaScript. This innovative framework opens up new possibilities for .NET developers, allowing them to leverage their existing skills to create modern web applications.&lt;br&gt;
In this article, we’ll dive into what Blazor is, how it works, its key features, and why it’s becoming a popular choice for web development.&lt;br&gt;
Introduction to Blazor&lt;br&gt;
Blazor is a modern web framework developed by Microsoft that allows developers to build interactive web applications using C# and .NET instead of JavaScript. Launched as part of the .NET ecosystem, Blazor enables developers to create rich, single-page applications (SPAs) that run directly in the browser via WebAssembly or on the server-side with SignalR for real-time communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features of Blazor&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. C# and .NET Ecosystem&lt;/strong&gt;&lt;br&gt;
Blazor allows developers to use C# for both client-side and server-side code, eliminating the need to switch between JavaScript and C#. This is a game-changer for .NET developers who can now build full-stack web applications using a single language and framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Component-Based Architecture&lt;/strong&gt;&lt;br&gt;
Blazor uses a component-based architecture, similar to other modern frameworks like React and Angular. Developers can create reusable UI components, making it easier to build and maintain complex applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. WebAssembly Support&lt;/strong&gt;&lt;br&gt;
Blazor WebAssembly enables high-performance client-side execution, bringing near-native speed to web applications. This makes it possible to run .NET code directly in the browser without plugins or additional software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Real-Time Updates with SignalR&lt;/strong&gt;&lt;br&gt;
Blazor Server uses SignalR, a real-time communication library, to send UI updates to the client. This ensures that the application remains responsive and up-to-date without requiring a full page reload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Integration with .NET Libraries&lt;/strong&gt;&lt;br&gt;
Blazor can leverage existing .NET libraries and tools, reducing the need for additional third-party dependencies. This allows developers to reuse code and libraries from their existing .NET projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Strong Tooling Support&lt;/strong&gt;&lt;br&gt;
Blazor benefits from Visual Studio’s robust tooling, including debugging, IntelliSense, and hot reload. This makes the development process smoother and more efficient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Blazor?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Familiarity for .NET Developers&lt;/strong&gt;&lt;br&gt;
For developers already familiar with C# and the .NET ecosystem, Blazor provides a seamless transition to web development. There’s no need to learn JavaScript or TypeScript, which can save time and reduce the learning curve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Full-Stack Development&lt;/strong&gt;&lt;br&gt;
Blazor enables full-stack development using a single language (C#) and framework (.NET). This simplifies the development process and allows for better code reuse between the client and server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. High Performance&lt;/strong&gt;&lt;br&gt;
With Blazor WebAssembly, applications can achieve near-native performance in the browser. This makes it suitable for building complex, data-intensive web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Real-Time Capabilities&lt;/strong&gt;&lt;br&gt;
Blazor Server’s use of SignalR makes it ideal for applications that require real-time updates, such as dashboards, chat applications, and live data feeds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Cross-Platform Compatibility&lt;/strong&gt;&lt;br&gt;
Blazor applications can run on any modern browser, including those on desktop and mobile devices. This ensures a consistent user experience across platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blazor comes in two hosting models:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Blazor WebAssembly:&lt;/strong&gt; This model runs the application directly in the browser using WebAssembly, a binary instruction format that allows high-performance execution of code. With Blazor WebAssembly, the entire application, including the .NET runtime, is downloaded to the client's browser, enabling full client-side execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Blazor Server:&lt;/strong&gt; In this model, the application runs on the server, and UI updates are sent to the client over a SignalR connection. This approach reduces the initial load time and is ideal for applications where client resources are limited.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Blazor leverages the power of Razor syntax, a combination of HTML and C#, to create dynamic and reusable UI components. This makes it an attractive option for .NET developers who want to build web applications without leaving the familiar .NET ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros of Blazor&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;C# and .NET Ecosystem:&lt;/strong&gt; Blazor allows developers to use C# for both client-side and server-side code, eliminating the need to switch between JavaScript and C#. This is a significant advantage for .NET developers who are already familiar with the language and tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Component-Based Architecture:&lt;/strong&gt; Like other modern frameworks, Blazor uses a component-based architecture, making it easy to create reusable and modular UI components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Full-Stack Development:&lt;/strong&gt; With Blazor, developers can build full-stack applications using a single language (C#) and framework (.NET), streamlining the development process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;WebAssembly Support: Blazor WebAssembly enables high-performance client-side execution, bringing near-native speed to web applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration with .NET Libraries:&lt;/strong&gt; Blazor can leverage existing .NET libraries and tools, reducing the need for additional third-party dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Updates with SignalR:&lt;/strong&gt; Blazor Server provides real-time UI updates using SignalR, making it ideal for applications that require live data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strong Tooling Support:&lt;/strong&gt; Blazor benefits from Visual Studio's robust tooling, including debugging, IntelliSense, and hot reload.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons of Blazor&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Learning Curve for Non-.NET Developers:&lt;/strong&gt; Developers who are not familiar with C# or the .NET ecosystem may find it challenging to adopt Blazor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Comparison with Angular, React, and Vue&lt;/strong&gt;&lt;br&gt;
Blazor competes with popular JavaScript frameworks like Angular, React, and Vue. Here's a detailed comparison:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Language and Ecosystem&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blazor:&lt;/strong&gt; Uses C# and the .NET ecosystem, making it ideal for .NET developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Uses TypeScript and has a robust ecosystem backed by Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Uses JavaScript (or TypeScript) and has a massive ecosystem supported by Facebook.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; Uses JavaScript (or TypeScript) and is known for its simplicity and flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Performance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blazor WebAssembly:&lt;/strong&gt; Offers near-native performance but has a larger initial load time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blazor Server:&lt;/strong&gt; Provides fast initial load times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Optimized for performance but can be heavy for small applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Known for its virtual DOM, which ensures efficient updates and rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; Lightweight and fast, with a smaller bundle size compared to Angular and React.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Learning Curve&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blazor:&lt;/strong&gt; Easier for .NET developers but may be challenging for those unfamiliar with C#.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Steeper learning curve due to its comprehensive feature set and complexity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Moderate learning curve, especially for developers new to JSX and functional programming.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; Easiest to learn, with a simple and intuitive API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Community and Ecosystem&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blazor:&lt;/strong&gt; Growing community but smaller compared to Angular, React, and Vue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Large community and extensive ecosystem backed by Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Largest community and ecosystem, with a vast number of third-party libraries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; Strong and rapidly growing community, with a focus on simplicity and flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blazor:&lt;/strong&gt; Ideal for .NET developers building SPAs or full-stack applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Suitable for large-scale enterprise applications with complex requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Versatile and widely used for both small and large applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; Perfect for small to medium-sized applications and rapid prototyping.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Blazor is a promising framework that brings the power of C# and .NET to web development. Its ability to run on both WebAssembly and the server-side makes it a versatile choice for developers. However, it still lags behind established frameworks like Angular, React, and Vue in terms of ecosystem size and community support.&lt;/p&gt;

&lt;p&gt;For .NET developers, Blazor offers a seamless transition to web development without the need to learn JavaScript. For others, the choice between Blazor and other frameworks will depend on factors like project requirements, team expertise, and performance considerations.&lt;/p&gt;

&lt;p&gt;As Blazor continues to evolve, it has the potential to become a strong contender in the world of web development, especially for organizations deeply invested in the .NET ecosystem.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>.NET 9 Revolutionizing documentation of APIs : From Swashbuckle to Scalar 🚀</title>
      <dc:creator>Arash zandi</dc:creator>
      <pubDate>Thu, 09 Jan 2025 09:49:22 +0000</pubDate>
      <link>https://forem.com/arashzandi/net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar-527</link>
      <guid>https://forem.com/arashzandi/net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar-527</guid>
      <description>&lt;h1&gt;
  
  
  Abstract
&lt;/h1&gt;

&lt;p&gt;API documentation is the backbone of modern software development. With .NET 9's shift from Swashbuckle to Microsoft.AspNetCore.OpenApi, developers need new strategies to stay efficient. This article explores these changes and introduces Scalar, a game-changer for API documentation.&lt;br&gt;
This article delves into the evolution and integration of Swagger in the ASP.NET ecosystem, with a focus on the new developments in .NET 9. It traces Swagger’s journey from its origins as an open-source project to its widespread adoption as the de facto tool for API documentation, testing, and client code generation in the .NET space. As .NET Core matured, Swagger tools like Swashbuckle streamlined the process of adding interactive documentation and OpenAPI support to ASP.NET applications. However, with the release of .NET 9, Swashbuckle.AspNetCore is being deprecated in favor of the Microsoft.AspNetCore.OpenApi library. The article provides practical guidance on how to incorporate Swagger into .NET 9 Web APIs and highlights the shift towards more modern, efficient tools. It also introduces Scalar .NET, an innovative platform that enhances Swagger with a sleek user interface and first-class OpenAPI support. Offering step-by-step instructions and code examples, this article serves as a comprehensive resource for developers looking to modernize their API documentation strategies in .NET 9.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Story of Swagger&lt;/strong&gt;&lt;br&gt;
The story of Swagger in ASP.NET is intertwined with the rise of API-driven development and the need for better ways to document, test, and interact with APIs. Here’s a breakdown of how Swagger became a key tool for ASP.NET developers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Rise of APIs&lt;/strong&gt;&lt;br&gt;
As RESTful APIs became central to modern application development, developers faced the challenge of creating clear and consistent documentation. Traditional documentation methods were error-prone and difficult to maintain, especially for large APIs.&lt;br&gt;
Swagger emerged in 2011 as an open-source project by Tony Tam. It aimed to standardize how APIs were described, enabling tools to generate interactive documentation, client SDKs, and server stubs automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Early Adoption in .NET&lt;/strong&gt;&lt;br&gt;
ASP.NET developers quickly saw the potential of Swagger. However, the integration was manual at first, requiring developers to write Swagger specification files (in JSON or YAML) by hand. This process was tedious and discouraged adoption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Swashbuckle Makes Swagger Seamless&lt;/strong&gt;&lt;br&gt;
Swashbuckle, created by Richard Morris, was a game-changer for ASP.NET developers. It provided an easy way to integrate Swagger into ASP.NET projects, automatically generating Swagger JSON from your Web API controllers and routes.&lt;br&gt;
Swashbuckle added features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Documentation:&lt;/strong&gt; Generating API documentation directly from code, using XML comments and data annotations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swagger UI Integration:&lt;/strong&gt; Embedding an interactive API documentation interface directly into your app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizability:&lt;/strong&gt; Allowing developers to extend and tweak the Swagger output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ASP.NET Core Era&lt;/strong&gt;&lt;br&gt;
When ASP.NET Core was introduced in 2016, it was built with modularity and flexibility in mind. This made integrating Swagger tools even more straightforward. Swashbuckle adapted to ASP.NET Core and became the de facto standard for Swagger integration.&lt;br&gt;
&lt;strong&gt;Key features during the ASP.NET Core era&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenAPI Specification:&lt;/strong&gt; Swagger transitioned to the OpenAPI standard in 2015, ensuring broader industry adoption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Middleware Support:&lt;/strong&gt; ASP.NET Core’s middleware architecture made it simple to add Swagger generators and UI middleware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Versioning Support:&lt;/strong&gt; Tools like Swashbuckle and NSwag supported multiple API versions, catering to evolving APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expanding Swagger Ecosystem&lt;/strong&gt;&lt;br&gt;
Today, ASP.NET developers have multiple options for working with Swagger:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Swashbuckle:&lt;/strong&gt; The most popular and feature-rich solution for ASP.NET Core.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NSwag:&lt;/strong&gt; Another powerful tool that supports OpenAPI and adds features like client code generation for TypeScript and C#.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Integration:&lt;/strong&gt; Swagger/OpenAPI specifications are often used to integrate APIs with Azure API Management.
Swagger’s Role in Modern Development
Swagger (or OpenAPI) in ASP.NET projects plays a pivotal role in:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration:&lt;/strong&gt; Bridging the gap between developers, testers, and stakeholders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; Generating client SDKs and testing tools automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Experience:&lt;/strong&gt; Allowing developers to explore and test APIs interactively through tools like Swagger UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Swashbuckle.AspNetCore is being removed in .NET9 (Is Swashbuckle is deprecated ?)&lt;/strong&gt;&lt;br&gt;
“&lt;em&gt;The ASP.NET Core team began shipping web API templates with a dependency on Swashbuckle in the .NET 5 timeframe. The decision allowed the team to provide built-in support for OpenAPI, a language-agnostic, platform-neutral representation of web-based APIs that contains everything needed to discover and interact with HTTP-based service endpoints. You may be more familiar with the name “Swagger” that refers to a set of tools for working with OpenAPI documents. The information in the OpenAPI document enables scenarios like client code generation, stubbing server code, creating documentation and dynamically producing a web-based UI to interactively test the API. It also is heavily used in artificial intelligence applications to provide prompts that describe the API for use by generative AI.&lt;br&gt;
Swashbuckle is a great project, and we appreciate the time and effort its owner and community contributors have put into it. The project is no longer actively maintained by its community owner. Issues have not been addressed or resolved, and there is not an official release for .NET 8. The ASP.NET Core team will provide a solution for this in the .NET 9 release. The plan is to remove the dependency on Swashbuckle.AspnetCore from the web API template and extend the capabilities introduced with Microsoft.AspNetCore.OpenApi to provide OpenAPI document generation.&lt;/em&gt;”&lt;br&gt;
For more details on the deprecation of Swashbuckle.AspNetCore, refer to &lt;a href="https://github.com/dotnet/aspnetcore/issues/54599" rel="noopener noreferrer"&gt;this GitHub issue&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Future of Swagger&lt;/strong&gt;&lt;br&gt;
With Microsoft continuously improving ASP.NET Core and OpenAPI becoming the industry standard, Swagger was expected to remain an integral part of the ecosystem. Features like minimal APIs in ASP.NET Core 6+ have made it even easier to integrate Swagger for lightweight and performant APIs. In spite of removing Swagger from Webapi samples it’s still updating and available to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to add Swashbuckle (in practice) to the .Net9 webapi&lt;/strong&gt;&lt;br&gt;
I’l tell you how to add Swagger into your .Net Web API project using SwashBuckle&lt;br&gt;
Before commencement ensure that .Net version 9 SDK is installed on your system properly&lt;/p&gt;

&lt;p&gt;First make a new webapi project with this comamnd&lt;br&gt;
&lt;code&gt;Dotnet new webapi -n OpenApi-Swagger-Scalar&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then Open your project in VsCode&lt;br&gt;
Next right click on an empty area in your project explorer and click on Open In &lt;strong&gt;integrated terminal&lt;/strong&gt;&lt;br&gt;
Next run this command&lt;br&gt;
&lt;code&gt;dotnet add package Swashbuckle.AspNetCore&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F948h6ew6x4kojnw54ac0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F948h6ew6x4kojnw54ac0.png" alt="VsCode Integrated Terminal" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it’s time to configure Swagger in &lt;strong&gt;Program.cs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(You see something about OpenApi in your &lt;strong&gt;program.cs&lt;/strong&gt;&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="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will We will discuss that topic later in this topic)&lt;/p&gt;

&lt;p&gt;Add these line below  : &lt;strong&gt;builder.Services.AddOpenApi();&lt;/strong&gt;&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="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddEndpointsApiExplorer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddSwaggerGen&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these lines below app.MapOpenApi()&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwagger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Enable the Swagger JSON endpoint&lt;/span&gt;
 &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Enable the Swagger UI&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run Your Project and open the uri :&lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:%7Byour_port%7D/swagger/index.html" rel="noopener noreferrer"&gt;http://localhost:{your_port}/swagger/index.html&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Or just navigate to &lt;strong&gt;/swagger&lt;/strong&gt;&lt;br&gt;
For example &lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:5000/swagger" rel="noopener noreferrer"&gt;http://localhost:5000/swagger&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Congrats! You have SwashBuckle Swagger in .Net9 again!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffug5muhy6dlo3713fcil.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffug5muhy6dlo3713fcil.jpeg" alt="Swashbuckle Swagger Demo" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Story of OpenApi&lt;/strong&gt;&lt;br&gt;
OpenAPI, formerly known as Swagger, is a specification for describing REST APIs. It allows developers to define the structure of their APIs, including endpoints, operations, parameters, and authentication methods, in a format that is both human-readable and machine-readable.&lt;br&gt;
The OpenAPI Specification (OAS) was originally developed by Tony Tam in 2010 as part of the Swagger project. The goal was to create a standard way to describe APIs, making it easier for developers to design, build, document, and consume APIs. In 2015, the Swagger project was donated to the OpenAPI Initiative, a consortium of industry leaders, and the specification was renamed to OpenAPI.&lt;br&gt;
Swagger tools, such as Swagger Editor, Swagger UI, and Swagger Codegen, were built around the OpenAPI Specification to help developers work with APIs more efficiently. These tools allow developers to write OpenAPI definitions, generate interactive API documentation, and create server stubs and client libraries in various programming languages.&lt;br&gt;
The ability of APIs to describe their own structure through OpenAPI has revolutionized API development, enabling better collaboration, automation, and integration across different tools and platforms.&lt;br&gt;
&lt;strong&gt;Let’s tell you the first secret 😊&lt;/strong&gt;&lt;br&gt;
In the test project from previous section you had these two lines in your Program.cs&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="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When debugging your test project let’s navigate to this link&lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:%7Byour_port%7D/openapi/v1.json" rel="noopener noreferrer"&gt;http://localhost:{your_port}/openapi/v1.json&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
for example&lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:5000/openapi/v1.json" rel="noopener noreferrer"&gt;http://localhost:5000/openapi/v1.json&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
You can see all documents about all your apis.&lt;br&gt;
&lt;a href="https://media2.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%2F31so5rwxcpfomo8mt7za.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F31so5rwxcpfomo8mt7za.jpeg" alt="OpenApi Demo" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenAPI vs. Swagger&lt;/strong&gt;&lt;br&gt;
The Swagger project was donated to the OpenAPI Initiative in 2015 and has since been referred to as OpenAPI. Both names are used interchangeably. However, "OpenAPI" refers to the specification. "Swagger" refers to the family of open-source and commercial products from SmartBear that work with the OpenAPI Specification. Subsequent open-source products, such as OpenAPIGenerator, also fall under the Swagger family name, despite not being released by SmartBear.&lt;br&gt;
In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAPI is a specification.&lt;/li&gt;
&lt;li&gt;Swagger is tooling that uses the OpenAPI specification. For example, OpenAPIGenerator and SwaggerUI.
You can read more here : &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-8.0" rel="noopener noreferrer"&gt;microsoft.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use SwaggerUI with the power of OpenApi json&lt;/strong&gt;&lt;br&gt;
So when we already have OpenApi as below&lt;br&gt;
&lt;code&gt;app.MapOpenApi();&lt;/code&gt;&lt;br&gt;
There is another choice, swagger can benefits from OpenApi documents to generate it’s UI instead of &lt;strong&gt;swagger json endpoint&lt;/strong&gt;&lt;br&gt;
Thus we can remove this line&lt;br&gt;
&lt;code&gt;app.UseSwagger();&lt;/code&gt;&lt;br&gt;
And Instead of this line&lt;br&gt;
&lt;code&gt;app.UseSwaggerUI();&lt;/code&gt;&lt;br&gt;
You can use like this&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SwaggerEndpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/openapi/v1.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Your Custom Title"&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;p&gt;&lt;strong&gt;Scalar, A game changer!&lt;/strong&gt;&lt;br&gt;
Scalar .NET is an open-source API platform that provides a modern REST API client and beautiful API references with first-class OpenAPI/Swagger support. The Scalar.AspNetCore package makes it easy to integrate the Scalar API reference into your .NET applications.&lt;br&gt;
You can read more &lt;a href="https://guides.scalar.com/scalar/scalar-api-references/net-integration" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to add Swashbuckle (in practice) to the .Net9 webapi&lt;/strong&gt;&lt;br&gt;
Install the package: Use the following command to add the Scalar.AspNetCore package to your .NET sample project:&lt;br&gt;
&lt;code&gt;dotnet add package Scalar.AspNetCore&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add this line above your &lt;strong&gt;Program.cs&lt;/strong&gt; to as the namespace&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;Scalar.AspNetCore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure that you have these lines in your &lt;strong&gt;program.cs&lt;/strong&gt;&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="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddEndpointsApiExplorer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddSwaggerGen&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add this line to the &lt;strong&gt;Program.cs&lt;/strong&gt;&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapScalarApiReference&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When debugging your test project let’s navigate to this link&lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:%7Byour_port%7D/scalar/v1" rel="noopener noreferrer"&gt;http://localhost:{your_port}/scalar/v1&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
for example&lt;br&gt;
&lt;strong&gt;&lt;a href="http://localhost:5000/scalar/v1" rel="noopener noreferrer"&gt;http://localhost:5000/scalar/v1&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
You can see a new modern and pretty cool UI to test your apis :&lt;br&gt;
 &lt;a href="https://media2.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%2F7v231408pa0uirr72bmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7v231408pa0uirr72bmv.png" alt="Scalar Demo" width="800" height="751"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to tell you the second secret 😊&lt;/strong&gt;&lt;br&gt;
Instead of this line&lt;br&gt;
&lt;code&gt;app.MapScalarApiReference();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;let’s use something like this&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="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapScalarApiReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Your Custom Title"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ScalarTheme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Mars&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithDefaultHttpClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ScalarTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CSharp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ScalarClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HttpClient&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;p&gt;Boom !!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8478i2ybv7q34l23mi9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8478i2ybv7q34l23mi9i.png" alt="Scalar Customized demo" width="800" height="851"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now You have your custom title&lt;/li&gt;
&lt;li&gt;You have an amazing theme&lt;/li&gt;
&lt;li&gt;You have C# codes as the default &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;All solutions&lt;/strong&gt;&lt;br&gt;
Now you have all this links for test with these lines of code existing in the &lt;strong&gt;Program.cs&lt;/strong&gt;&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="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddEndpointsApiExplorer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddSwaggerGen&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapOpenApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwagger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Enable the Swagger JSON endpoint&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Enable the Swagger UI&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;MapScalarApiReference&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Json Based Document for apis&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://localhost:5000/openapi/v1.json" rel="noopener noreferrer"&gt;http://localhost:5000/openapi/v1.json&lt;/a&gt;&lt;br&gt;
&lt;a href="http://localhost:5247/swagger/v1/swagger.json" rel="noopener noreferrer"&gt;http://localhost:5247/swagger/v1/swagger.json&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;UI based&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://localhost:5000/swagger/index.html" rel="noopener noreferrer"&gt;http://localhost:5000/swagger/index.html&lt;/a&gt;&lt;br&gt;
&lt;a href="http://localhost:5000/scalar/v1" rel="noopener noreferrer"&gt;http://localhost:5000/scalar/v1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
This article explores the evolution of Swagger in the ASP.NET ecosystem and its integration with .NET 9, focusing on OpenAPI and the Scalar platform.&lt;br&gt;
It begins by detailing the history of Swagger, its emergence as an open-source tool to standardize API documentation, and its early adoption by ASP.NET developers. The article highlights how tools like Swashbuckle made Swagger easier to integrate with ASP.NET Core, automating API documentation and enhancing the developer experience. As .NET Core evolved, Swagger became a key tool for API documentation, testing, and client code generation.&lt;br&gt;
With the release of .NET 9, Swashbuckle.AspNetCore is being deprecated, and the ASP.NET Core team plans to extend the Microsoft.AspNetCore.OpenApi library. The article provides practical steps for adding Swagger (via Swashbuckle) to a .NET 9 Web API project and discusses the removal of Swagger in Web API templates, suggesting alternatives for API documentation.&lt;br&gt;
The article also introduces Scalar .NET, a modern platform that enhances Swagger with a beautiful UI and OpenAPI support. It shows how to integrate Scalar into a .NET project, offering a more polished and customizable API reference solution.&lt;br&gt;
In summary, the article covers the history, evolution, and future of Swagger in the .NET ecosystem, along with practical guidance on using both Swagger and Scalar for efficient API documentation in .NET 9. And With the tools and insights provided, you're now ready to modernize your API documentation in .NET 9. Whether leveraging Scalar or sticking with OpenAPI, the key is to adapt and stay ahead of evolving standards.&lt;/p&gt;

&lt;p&gt;Source codes are available for download here :&lt;br&gt;
&lt;a href="https://github.com/zandiarash/Article-Swagger-Scalar-OpenApi" rel="noopener noreferrer"&gt;Github : https://github.com/zandiarash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eager to know how to Integrate Swagger, Scalar, OpenAPI with .Net Aspir?&lt;br&gt;
Read this article&lt;br&gt;
&lt;a href="https://dev.to/arashzandi/net-aspire-add-swagger-openapi-scalar-to-the-apphost-3ll6"&gt;https://dev.to/arashzandi/net-aspire-add-swagger-openapi-scalar-to-the-apphost-3ll6&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>minimalapi</category>
      <category>swagger</category>
      <category>openapi</category>
    </item>
  </channel>
</rss>
