Skip to content

dotLess does not seem to work at all in ASP.NET 4.5 #148

joshgarwood opened this Issue Mar 6, 2012 · 10 comments

7 participants


Hi there!

I'm just now getting my feet wet with dotLess in another project and am loving it thus far. This past weekend though, I cracked open the new Visual Web Developer 11 Beta to play around with a few things and discovered that dotless doesn't seem to work at at all there. I was first trying to use it with a custom Bundle and the new native bundling/minification system in MVC 4, and that didn't work. So I then tried to just use it normally and sadly got the same result. All of the normal css is read correctly, but the less pieces (such as mixins and variables) are totally ignored.

Am I missing something, or is this a known problem in that dotLess just isn't compatible with ASP.NET 4.5 and MVC 4? Thanks again!

dotless member

You might be the first or second to try it. If you do come up with any tips or a handler for 4.5 / MVC it would be nice to include it.

I imagine that writing a new handler that works like the old one but is good for 4.5 should be simple.


Thanks for the feedback agatronic! This is a bit new to me, but I'm definitely willing to do whatever I can to get this working. Do you have an idea of what would need to change in the handler for it to work with 4.5?

I read through the code and it seems like it should be working without an issue. I suspect that if there is an issue it may have something to do with the PandoraContainer and Pandora Fluent Registration, but that's purely a guess. And even then, I don't really know where to start. Any help or suggestions in getting things started would be much appreciated.

Thanks again!

dotless member

@chrisortman kindly created this gist

I haven't tried it yet, but once I am able, it would be good to include support in dotless.


I actually tried that yesterday as a matter of fact. The issue isn't so much with the bundling as it is with dotless working at all in ASP.NET 4.5. So if I use dotless in the default way (no bundling, minification, etc), it doesn't work unfortunatley.

After some more experimentation last night, I believe the issue is likely stemming from the LessHttpHandler as commenting out certain lines in the web.config (specfically the system.webserver->handler node for the LessHandler), I am at least able to get some styles to work, but none of the less features such as mixins.

I'm probably missing something completely obvious, but if I try the exact same thing in Visual Studio 2010 and ASP.NET 4 it works perfectly.


thanks man, it works fine for me

Note: although dont forget to add all .less File in your bundle, because of the change-monitor. It is not recognizing that the file (which you imported with .less @import statement) has changed.


I started off with @chrisortman's gist but like many examples I've seen they don't actually set up the cache dependencies for the imported LESS files. Unless you provide your own Bundle implementation the default Bundle class caches the bundle response using a cache dependency for each of the the files included in the Bundle.

I've uploaded my working solution to The bundle transformer sets up a cache dependency for each import if optimizations are enabled (you don't have to specify every LESS file when configuring your bundles).

Hope this helps.


I'm also running into the same issue, and I got @benfoster gist working with my project.

I would like to add the gist code to this project, but it requires the .Net 4.5 runtime which doesn't work with Visual Studio 2010.

If I submit a pull request that updates the solution to use Visual Studio 2012, would you accept it?

dotless member

@agatronic Do you want it in a completely different repository or living in this repository? I'm fine either way.


I don't think the path resolver works with Google Web font LESS such as: @import url('//,700,400italic,700italic');

@rytmis rytmis closed this Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.