【发布时间】:2022-09-14 22:20:33
【问题描述】:
我有使用 ABP 框架构建的 Angular 前端和 .NET 后端。部署后后端工作正常,但前端应用程序只加载 index.html 文件并且不会落后(还有一些 ngx 数据表 css 和其他一些 css 东西)。
另外,我在控制台中没有任何错误。
我的 web.config 文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
请注意,它在开发中运行良好。
我使用ng build 构建它并将所有文件复制到inetpub/www 文件夹。
【问题讨论】:
-
可以尝试使用failed request trace查看详细的请求信息,或许能找到原因。
标签: .net angular iis deployment abp