TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds

前端 未结 11 1971
天命终不由人
天命终不由人 2020-12-09 15:25

I\'m getting this error after upgrading to angular 9. I\'m using visual studio 2019, ASP .NET core with angular. Even if I create new project and update angular to 9 version

11条回答
  •  独厮守ぢ
    2020-12-09 16:09

    As suggested in https://developercommunity.visualstudio.com/solutions/446713/view.html, you should setup the StartupTimeout configuration setting.

    Basically in Startup.cs:

     app.UseSpa(spa =>
        {
          spa.Options.SourcePath = "./";
          //Configure the timeout to 5 minutes to avoid "The Angular CLI process did not start listening for requests within the timeout period of 50 seconds." issue
          spa.Options.StartupTimeout = new TimeSpan(0, 5, 0);
          if (env.IsDevelopment())
          {
            spa.UseAngularCliServer(npmScript: "start");
          }
        });
    

提交回复
热议问题