LESS file does not load (404)

I am using IIS 7.5 and I cannot upload fewer files because it gives a 404 error.

HTML:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Less Tutorial</title> <link rel="stylesheet/less" href="style.less" /> <script src="less-1.0.41.min.js"></script> </head> <body> <div id="container"> <a href="#">My Anchor</a> </div> </body> </html> 

LESS:

 @primary_color: green; #container { width: 200px; height: 200px; background: @primary_color; } 
+47
Apr 07 2018-11-11T00:
source share
5 answers

When using Asp.Net, you can add the mime type to your web.config:

 <system.webServer> <staticContent> <mimeMap fileExtension=".less" mimeType="text/css" /> </staticContent > </system.webServer> 
+96
Mar 28 2018-12-12T00:
source share

If using webmatrix, go to " Documents \ IISExpress \ config ", open "applicationhost.config" and add the line mimeMap fileExtension = ". Less" mimeType = "text / css" in the " staticContent " section. Hope this helps.

+8
Feb 14 '12 at 23:00
source share

In my MVC 5 application, I tried many of these approaches and could not solve the problem. Ultimately, I installed Web Essentials for VS 2013 and used the built-in LESS compiler. Each time you save a LESS file, it generates the appropriate CSS. In my layout, I just point to the CSS file and work on my problem.

+1
Nov 09 '14 at 20:08
source share

I encountered this error several times, and despite adding the mime type, I got the same error again and again.

Then I found that adding the mime type only fixes the 406 error code, not the 404. This has something to do with the privileges that I think.

So, try opening the file as Administator (for example, notepad.exe - notepad.exe run as Administrator ) and overwrite the file yourself. It worked for me.

0
Mar 03 '15 at 9:49
source share

Here is a good video tutorial that should start working -> http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-you-need-to-check-out-less-js/

EDIT: This is actually not a fix, but a little tip. always add type="text/css" when opening style tags or style sheet links in the link tag.

-2
Apr 07 '11 at 9:50 a.m.
source share



All Articles