Can I use asp.net core 3.1 with angualr 11

MD Tarikul Islam 1 Reputation point
2021-01-12T09:50:57.58+00:00

Can I use asp.net core 3.1 with angualr 11

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 32,076 Reputation points Microsoft Vendor
    2021-01-13T10:08:24.433+00:00

    Hi @MD Tarikul Islam ,

    Yes, you can use Asp.net core 3.1 with angular 11.

    You could refer the following steps to create a Asp.net core 3.1 application with Angular 11.

    1. Create a new Asp.net Core 3.1 application and use the Angular template: 56060-image.png
    2. Update the Angular version to Angular 11. In the ClientApp folder, delete the package-lock.json file, then, open the package.json file, you can see it using Angular 8 version, change the dependencies as below:
       "dependencies": {  
         "@angular/animations": "~11.0.6",  
         "@angular/common": "~11.0.6",  
         "@angular/compiler": "~11.0.6",  
         "@angular/core": "~11.0.6",  
         "@angular/forms": "~11.0.6",  
         "@angular/platform-browser": "~11.0.6",  
         "@angular/platform-browser-dynamic": "~11.0.6",  
         "@angular/platform-server": "~11.0.6",  
         "@angular/router": "~11.0.6",  
         "@nguniversal/module-map-ngfactory-loader": "8.2.6",  
         "aspnet-prerendering": "3.0.1",  
         "bootstrap": "^4.3.1",  
         "core-js": "^3.3.3",  
         "jquery": "3.4.1",  
         "oidc-client": "^1.9.1",  
         "popper.js": "^1.16.0",  
         "rxjs": "~6.6.0",  
         "zone.js": "~0.10.2"  
       },  
       "devDependencies": {  
         "@angular-devkit/build-angular": "0.1100.6",  
         "@angular/cli": "11.0.6",  
         "@angular/compiler-cli": "~11.0.6",  
         "@angular/language-service": "~11.0.6",  
         "@types/jasmine": "~3.6.0",  
         "@types/jasminewd2": "2.0.8",  
         "@types/node": "^12.11.1",  
         "codelyzer": "^6.0.0",  
         "jasmine-core": "~3.6.0",  
         "jasmine-spec-reporter": "~5.0.0",  
         "karma": "~5.1.0",  
         "karma-chrome-launcher": "~3.1.0",  
         "karma-coverage": "~2.0.3",  
         "karma-jasmine": "~4.0.0",  
         "karma-jasmine-html-reporter": "^1.5.0",  
         "typescript": "~4.0.2"  
       },  
       "optionalDependencies": {  
         "protractor": "~7.0.0",  
         "ts-node": "~8.3.0",  
         "tslint": "~6.1.0"  
       }  
      

    Then, build your application and running it, the output as below:

    56184-image.png

    [Note] You might meet the "The Angular CLI process did not start listening for requests within the timeout period of 0 seconds." error, if meet this error, try to clean the project first, then, running the application. And you could also check this thread: TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds

    0 comments No comments