Recently I installed ASP.Net MVC site with dotless on production server. Site worked well under Visual Studio built-in web server but after installation on IIS css styles were not applied. In our project we use file with .less.css extension in order to keep intellisense, syntax highlighting and in order to avoid problems with non-standard file extensions on web server. As documentation says we need to register dotless handler for such files in web.config:
And as I said it worked for built-in web server. But when I entered URL http://example.com/css/styles.less.css on production – I get original file without any modifications. I.e. all dotless artifacts like variables (@foo), mixins, etc. were not expanded to valid css.
The problem is that for integrated pipeline mode we need to add one more record into <system.webServer> section in web.config file:
After this dotless file was successfully transformed into valid css.