Dotless + MVC + Azure has garbage instead of CSS

606 Views Asked by At

I've used the Nuget to add Dotless to my Azure MVC4 project. It is not working. I've triple-checked it all and it seems to be fine. When I download the less file, this is the contents:

‹      ì½`I–%&/mÊ{JõJ×àt¡€`$Ø@ìÁˆÍæ’ìiG#)«*ÊeVe]f@Ìí¼÷Þ{ï½÷Þ{ï½÷º;N'÷ßÿ?\fdlöÎJÚÉž!€ªÈ?~|?"~—?ö7ø5ðü:¿Æ÷÷ÿúÀïtögüî¿ðîâŸùÅàw~ÅwþÍÿ¨ý‹ƒ?èø-·ëOú=³ÿîþ£þùÿâOùï~çâó¿ó×~ëþgòŸÌ¿þÛüžÿÜÿçÿ}¿ò?øÅÿãß/ÿü=‡þ‹åøÿ¿ïùì×,ÿ×á;ÿÎ?ýü®Ð_óOý.¿Ç/ý™ßå÷øè—þ§ÿÙÞ_ûÇ–¯þ‹ÿú¼þêŸÿ/ÿëÿ×ßðÅû¿÷âW]ÿÍÿÜEñ·?ÿ½þ÷ßý—üY¿Í?ûËÿ¾¿è¯ø]þÃÏþê?cñ”ÿão“ÿâ‡ã_öWüªÿí_®þ¼¿ì¿þ•¿É?ðoýãÍ‹ÿ°zðÿ¦ÿËçï¯þk¯þÈÿãß?ù?—?õ§õþSÿãŸøþ—ÿîgÿàïòKþ·¿ÿßÿÉývå¿øËþ“ÉpôïüÎÿáßûþoÿ÷¯óküÿ÷ÿýçÿ’ã¿éïù5~_ãÿ   ÿÿiÓÀû   

Unfortunately it appears to not be downloading correctly. Any idea why this might be the case when adding to a Windows Azure project in the Dev environment?

2

There are 2 best solutions below

0
On BEST ANSWER

It looks like the response is being gzip compressed twice.

By default dotless handles the gzip/deflate compression, but since you can switch on IIS to do this, you can disable dotless from doing it by adding the handleWebCompression="false" attribute to the config section node.

0
On

When you say "run outside of Azure" - where? The VS2010 Development Server or full IIS?7

Take a look at the mime types, and handlers.

Make sure .less is mapped in the IIS7 section and not just section. The former is for IIS7.

Try to get it to run under IIS Express if you don't have IIS7 installed.

There's nothing much more magical on Azure other than it's Windows Server 2008 or 2008 R2 and IIS7+.