0

I’m currently working on a project where the front-end is built using Angular 16, while the back-end is in ASP.NET

The challenge I’m facing is debugging the Angular production code integrated within the ASP.NET environment.

Background: We load some settings on the default.exe page, and then we load the production build of our Angular application on the same page. Whenever we make changes to the Angular code, we have to rebuild the Angular app for production and then run the default.exe page to see the changes. While this process works fine for testing and deploying the application, debugging the production code has been quite challenging. With the minification and optimization done during the production build, it’s hard to trace issues and bugs. Although I have enabled source map.

Q: Is there a way to debug the Angular production code more effectively?

Q: Can we convert the production code into development code, perhaps by making some configuration changes?

3
  • for debug builds, ng serve is much more convenient. (it'll serve an in-memory build from a node.js localhost server) You can then make calls to your debug localhost ASP.NET server. You might also make calls to a production server or a staging server (though care is needed if you made calls to production!) There are CORS issues to workaround, but there are various solutions for that. If you must use ng build, you might find ng build --watch useful as it will hot-rebuild on changes. Commented Apr 12, 2024 at 22:06
  • also remember that the ASP.NET .exe is serving static files. (index.html, .js files, .css that Angular builds) Commented Apr 12, 2024 at 22:16
  • ASP.NET or ASP.NET Core? Which project template (SPA or not) was used to create the backend? Without such key information, you are forcing others to guess (like the other comments).
    – Lex Li
    Commented Apr 25, 2024 at 4:52

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.