IIS with localized Angular application

Viewed 151

I'm using angular (version 10) i18n localization in ASP.NET application. After deploy I can open my app and use navigation, but after page refresh I got

{"StatusCode":500,"Message":"Internal Server Error occured."}

I tried to use rewrite rules like in this question, but it's not working

2 Answers

There are many reasons for the 500 error, you need to further analyze this error, I suggest you try to use failed request tracking to view detailed error information.

More information about the use of failed request tracking you can refer to this link: Using Failed Request Tracing to Trace Rewrite Rules.

The problem isn't in IIS rewrite rules. If you have same problem, try to do this:

  1. Open your app.module.ts
  2. In import block add or replace RouterModule with this

RouterModule.forRoot(your_routes, {useHash: true})

Related