0

Scenario: I created an ASP.NET Core 2.1 project in Visual Studio 2017. I selected the Angular SPA template and then added Docker Orchestration Support.

Expected Result: When running the application in debug mode in a container, I expect the changes I am making in the html content to be visible on the browser when I hit refresh.

Actual Result: Live Preview is not working. I do know that if I run the application on localhost, Live Preview works. I also know that regular ASP.NET MVC Core apps without Angular, running in a container also support live preview.

Is there something I am missing or Live Preview is not supposed to work for my scenario? If that is true it is unfortunate because if I have to rebuild the container every time I make a UI change I will lose a lot of time.

Apollonas
  • 647
  • 1
  • 5
  • 12

1 Answers1

0

I was able to get the live updating of changes to Angular pages with Docker support in Visual Studio 2017 by using:

ng build --watch

instead of:

ng serve --watch

I no longer have to run

ng build

after every change.

Hope this helps!

James
  • 913
  • 1
  • 9
  • 14
  • Hi @James. Can you share you dockerfle and docker-compose file or tell me where did you make those changes? Thanks – lcssanches Mar 21 '19 at 13:21
  • I did not make any changes to the dockerfile or docker compose file. After I push the “Docker compose” debug green arrow in Visual Studio 2017, I right click my project folder and choose “explore”. I then go to the Windows file explorer where I choose file>open windows powershell as administrator. I then type ng serve —watch into the poweshell window. – James Mar 22 '19 at 19:18