question

NimishSrivastav-6799 avatar image
0 Votes"
NimishSrivastav-6799 asked Bruce-SqlWork answered

Why ASP.NET Core 3.1 application installs Angular v8 on it's own?

Hi,

I have been trying to create a simple CRUD app using Angular v12 (the latest version) and .NET Core 3.1. Whenever I try to create project in VS, it created project with Angular v8. So I installed Angular v12 globally. But still it uses Angular v8 in the project and not taking a Angular version which is globally installed.

I am not able to find the solution for this issue. Any help would be highly appreciated.

Thanks,
Nimish Srivastav

dotnet-aspnet-core-generaldotnet-entity-framework-core
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JerryCai-MSFT avatar image
0 Votes"
JerryCai-MSFT answered JerryCai-MSFT edited

Hi,NimishSrivastav

Angular version 8 to version 12 needs 10.13 or higher.

If you are sure that you have installed the v12, have you applied it to your project?

You can follow the full steps in this link to update your angular in asp.net core:

update.angular.io

Best Regards,
Jerry Cai


If the answer is helpful, please click "Accept Answer" and upvote it.
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AsjadButt-2119 avatar image
0 Votes"
AsjadButt-2119 answered

you can try and create both of the projects separatly on and then inject the api into the angular project of any version it is

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

the angular template for .net 3.1 has not been updated. the version of angular is based on package.json file in the template

the easiest way to update a new project:

go the project root
delete ClientApp folder
create new angular project: ng new clientapp
rename folder clientapp to ClientApp

.note: as .net 3.1 support ends 12/13/2022, you really should not start new project with it. .net 6 changes how spa projects are developed and tested (uses node proxy rather than .net proxy), so you are better off starting .net 6

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.