为什么asp.net core 3.0 reactjs应用程序仅在刷新浏览器后才会出现?

问题描述 投票:2回答:1

我将。net core 2.2 reactjs应用程序升级为。net core 3.0。我在Visual Studio 2019中运行它。出现以下错误:

System.Net.Http.HttpRequestException: Failed to proxy the request to http://localhost:51719/, because the request to the proxy target failed.

如果刷新加载页面,则加载正常。为什么加载缓慢或出错?

reactjs asp.net-core visual-studio-2019
1个回答
0
投票

简而言之:

Angular CLI过程需要一些时间来构建项目。如果您在命令行中运行npm start,请先等待其完成,然后再使用.net或...]启动F5项目。

有些人找到了解决方法:尝试注释掉该行:

spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");

startup.cs文件中并使用

spa.UseAngularCliServer(npmScript: "start");

希望对您有意义。

© www.soinside.com 2019 - 2024. All rights reserved.