4

I've created a react project using asp.net core react spa template. Everything seems to be fine, but when I deployed the application in IIS, it is deployed as an application under the default website. When I try to access the site, the index file is coming, but static files are giving 404.

One solution I found is setting PUBLIC_URL to application name in iis and building the application and then deploy. But, Is there any other alternative solution from asp.net core side? like setting rootPath

// In production, the React files will be served from this directory
        services.AddSpaStaticFiles(configuration =>
        {
            configuration.RootPath = "ClientApp/Build";
        });
hashbytes
  • 769
  • 1
  • 8
  • 26
  • What exactly is the "application name" you've mentioned? I'm having the same issue :\ – Geraldo Neto Jan 31 '20 at 22:12
  • 1
    we have the react app deployed like this. domainname/{appname} appname is just an orbitary name.. But, for us, the Public_Url thing worked as we are going to maintain the same deployment structure in higher environments too. – hashbytes Feb 03 '20 at 14:24

0 Answers0