gpt4 book ai didi

c# - 带有 ASP-NET 和 Angular 的 Visual Studio 在浏览器中显示 TimeoutException

转载 作者:行者123 更新时间:2023-11-30 22:54:07 24 4
gpt4 key购买 nike

当等待 60 秒后开始调试时,这会显示在浏览器中。刷新浏览器窗口,15 秒后一切正常

An unhandled exception occurred while processing the request. TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 50 seconds. Check the log output for error information.

有什么想法吗?

最佳答案

那是因为 Angular CLI 的引导速度不够快,所以要修复它你有 2 个选项

增加 Startup.cs 中的超时时间

app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.Options.StartupTimeout = new TimeSpan(0, 0, 80); // 80 seconds
spa.UseAngularCliServer(npmScript: "start");
}
});

或导航到 ClientApp 文件夹运行 ng serve 并等待编译过程完成,以便您可以再次运行您的项目

更新:我发现解决此错误的方法是在 cmd 中运行 dotnet run

关于c# - 带有 ASP-NET 和 Angular 的 Visual Studio 在浏览器中显示 TimeoutException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56592080/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com