1

I tried to publish an Angular 5 app and a .NET Core Web Api to the same server (IIS with .NET Core bundle), however when I start it up, it just shows a blank page (no console errors or log errors). The Web API works (tested with postman), so I'm guessing it might be a routing issue. The angular 5 app is a fresh one created with Angular-Cli and build to production using

ng build --prod and then copied the content of the dist folder over into wwwroot

The .NET Core Web Api is also a fresh API with just a basic GET request, published using:

dotnet publish --self-contained -r win-x64 -c Release

and then copied the content into wwwroot, which means all of angular files and .net core files are in same directory. I haven't touched the web.config.

If I only publish the angular app it works.

What am I missing here?

user1725266
  • 456
  • 1
  • 4
  • 22
  • You can use `ng build --prod -op wwwroot` to build ng app in wwwroot folder and then configure routing like https://code.msdn.microsoft.com/How-to-fix-the-routing-225ac90f – yurzui Apr 14 '18 at 15:39

1 Answers1

0

Go to the index.html of your published angular app and find

<base href="/">

Change it to

<base href="">
Tong
  • 697
  • 1
  • 8
  • 16
  • Apparently when it builds the angular application, it puts all the files in the root. – Tong Jan 31 '19 at 19:56