4 Answer(s)
-
0
Hi @nssiva
Could you please share how you published the dist folder when publishing your Angular application to IIS? Did you follow the steps outlined in this documentation?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
yes @oguzhanagir
As in the documentation, i did and published
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @nssiva
Since the application is running but the styles are not loaded on IIS, the Angular build is probably OK. This usually happens because the CSS/assets are not being served from the expected IIS path, the wrong publish folder was copied, or IIS is rewriting/static-serving those files incorrectly.
Could you please verify the following steps in order?
- Open the deployed site in the browser and press
F12. - Go to the
Networktab and refresh the page with cache disabled. - Filter by
CSSand check the failed stylesheet requests. - Please confirm the exact requested URL and status code for the CSS files, for example
404,403, or200withtext/htmlcontent. - Check that you copied the actual Angular build output to the IIS site root. In recent Angular versions, the final files may be under
dist/browser, not onlydist. The IIS physical path must directly contain files likeindex.html,styles.*.css,main.*.js, and theassetsfolder. - Make sure the Angular
web.configfile is also copied to the IIS site root together withindex.html. - If the Angular app is hosted under a virtual directory/application path, for example
https://domain.com/myapp/, publish it with the correct base href:
npm run publish -- --base-href /myapp/- If the Angular app is hosted directly under the domain root, for example
https://domain.com/, the default<base href="/" />is correct. - Confirm that IIS has Static Content enabled and that
.css,.js,.json,.woff, and.woff2files are served correctly. The ASP.NET Zero Angularweb.configalready includes the required MIME mappings for.json,.woff, and.woff2. - Clear the browser cache or test in an incognito window after redeploying.
The most important checks are the Network tab result and the IIS physical folder content. If the CSS request returns
404, it is usually a wrong folder orbase hrefproblem. If it returns200but the response isindex.html/text/html, IIS rewrite is catching the CSS request because the file is not found at that path.Please share the CSS request URL/status from the Network tab and a screenshot/list of the IIS physical folder contents if the issue continues.
Best regards
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) - Open the deployed site in the browser and press
-
0
Thanks oguzhanagir
It is working now. Thanks
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
