![](/img/trans.png)
[英]Deployed .NET Core MVC Application to IIS, App is running, but Static files in wwwroot are not being loaded
[英]Angular ABP application not working after being deployed to IIS server, no errors in console
我有使用 ABP 框架構建的 Angular 前端和 .NET 后端。 After deployment backend is working fine but frontend app just loads index.html
file and doesn't go behind that (also some ngx datatable css and some other css stuff).
另外,我在控制台中沒有任何錯誤。
我的 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
文件夾。
嘗試這個
<action type="Rewrite" url="/" />
解決了。
問題出在 IdentityServer 中。 我創建了 IdentityServer 沒有分成不同項目的項目。 因此,由於某種原因,部署后無法自動對用戶進行身份驗證。 在對后端和前端的配置進行了一些更改后,我將其直接添加到數據庫中,現在它可以工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.