Troubleshooting IIS Deployment for Angular 11 and .NET Framework 4.7 Applications
Defiant_Priority_801 outlines challenges encountered while deploying an Angular 11 and .NET Framework 4.7 application stack to IIS, particularly struggling with 404 errors after following standard deployment procedures.
Defiant_Priority_801 is seeking assistance with deploying a full-stack application—with an Angular 11 frontend and a .NET Framework 4.7 backend—to Internet Information Services (IIS). While both parts of the application run as expected locally, deployment to IIS results in a StatusCode 404 (Not Found) when attempting to access the site.
Stack Details
- Frontend: Angular 11
- Backend: .NET Framework 4.7
Deployment Steps
- IIS Site Setup:
- Separate IIS sites are configured for the frontend and backend.
- Angular Frontend:
- Built for production using
yarn build --prod
. - The
/dist
directory produced by the build is copied toc:\inetpub\wwwroot\frontend
.
- Built for production using
- Backend:
- Published using
msbuild publish
, targeting the backend site folder.
- Published using
- Configuration:
- Each IIS site contains its own
web.config
file.
- Each IIS site contains its own
Problem Encountered
When visiting the assigned server IP (e.g., http://SERVERIP), a 404 Not Found error is shown instead of the expected application pages.
Possible Issues and Best Practices
- Site Bindings: Ensure IIS bindings are set correctly, and that the hostname or IP addresses match requests.
- Physical Path: Verify the physical paths for both frontend and backend directories point to the deployed code.
- web.config Files: Confirm that the
web.config
files are correctly set up for Angular (potential URL rewrite for client-side routing) and for .NET backend configuration. - App Pool Configuration: Double check app pool settings, ensuring .NET CLR version compatibility for the backend site.
- Static File Serving: Make sure IIS is configured to serve static files for Angular and proper handlers are installed.
- Firewall/Permissions: Validate that there aren’t firewall or NTFS permission issues preventing file access.
- Port and URL Matching: Confirm that access URLs correspond to the correct site bindings and content roots.
- Network Access: Check that the server’s firewall is not blocking inbound HTTP requests to the sites.
Seeking Community Advice
The author invites advice and recommendations from the community for optimal deployment practices tailored to Angular and .NET Framework applications running on IIS, as well as troubleshooting tips for resolving the persistent 404 errors.
This post appeared first on “Reddit DotNet”. Read the entire article here