Few minutes ago a colleague and friend asked me about some problem he was having with ASP.NET themes. He was using a theme and including a CSS file in it, the CSS file was linked in the generated HTML but clearly it was not applied. Putting the URL of the CSS file in the browser address bar would return an empty result in Firefox, and a crappy DOCTYPE,HTML,HEAD,BODY tags in IE. The same website works normally with other developers running Windows XP or Windows 7.
Going further to the problem, I tried checking the file access, giving extra permissions and so on, checking web.config and global.asax for any ASP.NET HTTP Handler or HTTP Module that might be handling all requests. None of this existed. Then, I switched to IIS, trying to change the website from custom Application Pool to default integrated pipeline one to default classic (IIS 6 like) one, but no use.
Now I started thinking, images in the website didn’t show also! I didn’t know whether this was a DB/code issue or related to not showing the CSS, well, maybe something is wrong with IIS installation, right? Well, exactly!!!
Here’s what the problem was:
Having installed IIS 7.5 for the first time, the guy thought he just needed to choose ASP.NET features in WWW, he never realized he has to have “Static Content” checked as well. It was really funny when discovered!
Wouldn’t you agree?
How did I learn that?
As a bonus for coming here, I'm giving away a free newsletter for web developers that you can sign up for from here.
It's not an anything-and-everything link list. It's thoughtfully collected picks of articles and tools, that focus on Angular 2+, ASP.NET (4.x/MVC5 and Core), and other fullstack developer goodies.
Take it for a test ride, and you may unsubscribe any time.
You might also want to support me by checking these out [Thanks]: