Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

497
Visualizações
Updating ASP.Net Core Angular template from Version 8 to 9

The book that i read has version 9 from the beginning (ASP.NET Core 3 and Angular 9 - Third Edition) and uses also the angular template. I have the latest visual studio updates for vs 2019 installed.

The template of a Angular project has version 8. The book I read is with version 9. So i try to update my angular version. ng update gives me

@angular/cli 8.3.14 -> 9.0.3 ng update @angular/cli

@angular/core 8.2.12 -> 9.0.3 ng update @angular/core

@nguniversal/aspnetcore-engine 8.1.1 -> 8.2.6 ng update @nguniversal/aspnetcore-engine

I updated cli and core. But when I try to update the third package I get:

C:\Users\user\Test\ClientApp>ng update @nguniversal/aspnetcore-engine
Using package manager: 'npm'
Collecting installed dependencies...
Found 39 dependencies.
Package '@nguniversal/aspnetcore-engine' is not a dependency.

I tried to run the application anyway and I get as HTML

Cannot GET /

Or a exception page with:

System.TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds. Check the log output for error information.
   at Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout[T](Task`1 task, TimeSpan timeoutDelay, String message)
   at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task`1 baseUriTask, CancellationToken applicationStoppingToken, Boolean proxy404s)
   at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Maybe is a little late but maybe this helps others. I faced the exact same problem. To make it work do this in the package.json.

Change

"scripts":{
   ...
   "start": "ng serve"
   ...
}
 
"scripts":{
   ...
   "start": "echo Starting... && ng serve"
   ...
}
 

This was taken from a comment by Smatusan. This is the explanation of why it works.

"Because this problem frequently occurs due to the initial build time of ng serve exceeding the programmed timeout window of the .NET SPA service, so by giving it the echo, the .NET SPA service receives some data and believes it's connected." - mikejunt.

The complete issue on GitHub can be found on the Angular side and the .NET side

over 4 years ago · Santiago Trujillo Relatório

0

I had a similar issue when I upgraded my angular version to 11 and was still running .net core 3.1.

How I solved it:

Completed Angular updates (ensure node modules are all up to date as well) Installed .Net core 5.0 Right click solution->properties->Application: Target Framework dropdown (change to recently installed 5.0) Save changes Manage Nuget packages -> Update Microsoft.AspNetCore.SpaServices.Extensions to version 5+

Then i was able to launch my debug sessions as normal.

over 4 years ago · Santiago Trujillo Relatório

0

When upgrading Angular from v8 to v9 'ng update' adds this line in main.ts

export { renderModule, renderModuleFactory } from '@angular/platform-server';

Just remove it, and the above error is gone, check this link

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda