Livnat Menashe
Livnat Menashe

Reputation: 911

After deploying an Angular 6 Application in IIS I'm getting a blank page with no error

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.

Upvotes: 3

Views: 5485

Answers (3)

Michael O
Michael O

Reputation: 71

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.

Upvotes: 2

Ashokan Sivapragasam
Ashokan Sivapragasam

Reputation: 2199

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!

Upvotes: 1

Livnat Menashe
Livnat Menashe

Reputation: 911

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)

Upvotes: 0

Related Questions