2

I've deploy an Angular 6 Application with asp.net mvc in IIS and i"m getting a blank page.

it's only present the title inside the <head> in the html but not all contents - angular 6 components inside.

i build the dist folder:

ng build --prod --base-href /ePortal/

with 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="/ePortal" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>
</configuration>

then i have created an application in IIS

Please advice.

Livnat Menashe
  • 831
  • 2
  • 9
  • 17

3 Answers3

2

I found that keeping <base href=""> as empty worked, whenever I refresh the page, there is no longer a 404 error showing up. I'm not sure why this is the case however, I'll keep researching on this.

Michael O
  • 71
  • 1
  • 7
1

Have you added base-href in html header?

<html>
   <head>
     ...
     <base href="/ePortal/">
     ...
   </head>
</html>

Have you deployed the dist folder package as, 'ePortal' at IIS Server?

From the example, it looks like you also referred KudVenkat's Deploy angular app to IIS :)

UPDATE: For IE 10 & IE 11 browsers, you need to uncomment a few lines in Polyfills.ts to import a few libraries. You refer to @Belen Martin's answer from this thread. It worked for me. I always thought IE won't support Angular website. Thanks for this question!

Ashokan Sivapragasam
  • 2,033
  • 2
  • 18
  • 39
0

On the server wasn't installed chrome so i checked it with explorer and didn't work.. after i installed chrome - the page load good - so the problem solved (at least on chrome)

Livnat Menashe
  • 831
  • 2
  • 9
  • 17