Dotlesscss @import statement: can't find file. Using Combres

1.2k Views Asked by At

In an asp.net mvc 3 project, i'm using Combres to combine and minify my CSS files. I'm using the dotlesscss filter for fancy css extras such as variables.

However, when i try to use the dotlesscss @import statement (see importing at bottom of page), css generation failes with the following error:

Could not find a part of the path 'C:\Program Files (x86)\IIS Express\colors.less'.

It's clear that the dotless compiler is looking in the wrong directory, however: how to fix this?

[edit]: as requested: i tried the following synaxes:

@import "Colors.less"
@import "~/Content/Colors.less"
2

There are 2 best solutions below

3
David Walschots On BEST ANSWER

Use the DotlessCssCombineFilter instead of the DotlessCssFilter. Then remove the @import statements from your *.less files, and instead import the *.less files in the right order inside the resourceSet.

1
Paul Knopf On

The accepted answer is a work around, not a fix.

Here is the fix to the issue and here is the suggestion to the Combres team.