<?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: Kibria</title>
    <description>The latest articles on DEV Community by Kibria (@gkibria).</description>
    <link>https://dev.to/gkibria</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%2F3835876%2F424d932a-d519-4418-b30c-0944357c7300.png</url>
      <title>DEV Community: Kibria</title>
      <link>https://dev.to/gkibria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gkibria"/>
    <language>en</language>
    <item>
      <title>VS2022's Angular and ASP.NET Core Template Is Stuck on Angular 19 — Here's the Workaround</title>
      <dc:creator>Kibria</dc:creator>
      <pubDate>Tue, 24 Mar 2026 19:24:34 +0000</pubDate>
      <link>https://dev.to/gkibria/vs2022s-angular-and-aspnet-core-template-is-stuck-on-angular-19-heres-the-workaround-11fj</link>
      <guid>https://dev.to/gkibria/vs2022s-angular-and-aspnet-core-template-is-stuck-on-angular-19-heres-the-workaround-11fj</guid>
      <description>&lt;p&gt;If you recently updated your Angular CLI and then tried to create a new project using Visual Studio 2022's "Angular and ASP.NET Core" template, you may have hit a wall. The project creation fails, and the error points at &lt;code&gt;ng&lt;/code&gt; — even if Angular CLI is clearly installed on your machine.&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%2Fpr904hsytk3wprqbfea1.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%2Fpr904hsytk3wprqbfea1.png" alt="Visual Studio 2022 error: Version of Angular CLI was not valid" width="460" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting the error, my first instinct was to update Angular CLI to the latest. That brought it to CLI 21.2.3 at the time. Went back to Visual Studio, tried again — still the same error. Updating hadn't helped. A bit of searching later, it pointed to the template itself being the problem.&lt;/p&gt;




&lt;h3&gt;
  
  
  What's happening
&lt;/h3&gt;

&lt;p&gt;The VS2022 Angular and ASP.NET Core template depends on &lt;strong&gt;Angular CLI 19&lt;/strong&gt; to scaffold the project. It has not been updated to work with Angular 20 or later.&lt;/p&gt;

&lt;p&gt;So if your machine has Angular CLI 20, 21, or newer globally installed — which is likely if you've been keeping up — the template simply can't do its job. It's not a bug in your setup. The template itself is behind.&lt;/p&gt;

&lt;p&gt;Microsoft's own documentation acknowledges this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"There is a compatibility issue with Angular 20.x.x and the Angular and ASP.NET Core template in Visual Studio 2022."&lt;/em&gt;&lt;br&gt;
— &lt;a href="https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?view=vs-2022&amp;amp;source=recommendations" rel="noopener noreferrer"&gt;learn.microsoft.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  The workaround
&lt;/h3&gt;

&lt;p&gt;The approach is two steps: satisfy the template first, then bring your app up to date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 — Temporarily install Angular CLI 19 globally&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check your current global CLI version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it's 20 or above, swap it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm uninstall &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli@19
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now go back to Visual Studio 2022 and create the project using the "Angular and ASP.NET Core" template. It should work. You may see a warning about your Node version not being officially supported by Angular 19 — that's expected and fine for this step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 — Upgrade the Angular app to the current version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The generated project will be on Angular 19.x. Since you're probably running a newer Node version and want to stay current, upgrade the Angular version inside the project — step by step, as Angular's migration guide recommends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# From the Angular project folder&lt;/span&gt;

&lt;span class="c"&gt;# 19 → 20&lt;/span&gt;
ng update @angular/core@20 @angular/cli@20

&lt;span class="c"&gt;# 20 → 21&lt;/span&gt;
ng update @angular/core@21 @angular/cli@21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't skip versions. Angular's incremental update process handles breaking changes and schematic migrations properly when you go one major at a time.&lt;/p&gt;

&lt;p&gt;After both upgrades, the project is on Angular 21 — the current version at the time of writing — and the local toolchain is consistent again.&lt;/p&gt;




&lt;h3&gt;
  
  
  After you're done
&lt;/h3&gt;

&lt;p&gt;Once the project is created and upgraded, you can restore your global CLI to the latest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your new project now has its own local CLI version locked in &lt;code&gt;package.json&lt;/code&gt;, so the global version won't interfere with it going forward.&lt;/p&gt;




&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The Angular and ASP.NET Core template of Visual Studio 2022 hasn't caught up with Angular 20+&lt;/li&gt;
&lt;li&gt;Downgrade your &lt;strong&gt;global&lt;/strong&gt; CLI to 19 temporarily to unblock project creation&lt;/li&gt;
&lt;li&gt;Then upgrade the &lt;strong&gt;project's&lt;/strong&gt; Angular version to where you actually want to be&lt;/li&gt;
&lt;li&gt;Restore your global CLI afterward&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The template is the bottleneck here, not your machine. Work around it, then move on.&lt;/p&gt;

</description>
      <category>aspnet</category>
      <category>visualstudio2022</category>
      <category>angular</category>
      <category>dotnet</category>
    </item>
  </channel>
</rss>
