Angular templates in Visual Studio

Pappas Alexandros 1 Reputation point
2023-10-24T11:30:32.5733333+00:00

Can someone please explain what are the differences between the templates "ASP.NET Core with Angular" and "Angular and ASP.NET Core (Preview)" in Visual Studio 2022, Version 17.7.4?

Developer technologies ASP.NET ASP.NET Core
Developer technologies Visual Studio Other
Developer technologies C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-10-24T13:25:16.0633333+00:00

    Hi @Pappas Alexandros

    Welcome to Microsoft Q&A! 

    The ASP.NET Core with Angular project template provides a convenient starting point for ASP.NET Core apps using Angular and the Angular CLI to implement a rich, client-side user interface (UI). The project template is equivalent to creating both an ASP.NET Core project to act as a web API and an Angular CLI project to act as a UI. This project combination offers the convenience of hosting both projects in a single ASP.NET Core project that can be built and published as a single unit. The project template isn't meant for server-side rendering (SSR).

    For Angular and ASP.NET Core (Preview) project template, it is a TypeScript template and creates two projects including a frontend Angular project and a backend ASP.NET Core project.

    You can see the following document: Tutorial: Create an ASP.NET Core app with Angular in Visual Studio

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     

     

    0 comments No comments

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-10-24T16:08:36.29+00:00

    the SPA template has evolved over time.

    the first template create a folder ClientApp and placed a node project in the folder. The project file had an action to build the node projects. for dev, a special spaproxy was used that would start the node project in watch mode and proxy requests to the node server

    as spa proxy needed to know how to start the node project, it was limited in the number of spa platforms it supported. as almost all SPA platforms supported proxy to a backend, the second iteration of spa templates switch to use the framework proxy.

    as better support for node spa projects was added to visual studio (and code), the preview templates moved the ClientApp folder to its own node projects. This means the startup logic is in node project. the webapi project just reference a node project and knows to run the startup project in the node project.

    also each iteration of the spa projects updated the spa framework versions supported. also the spa projects templates were simplified to use less dependencies.

    So the preview will create separate projects, and use a more current version of angular. For a new project you should probably pick the preview.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.