5

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"
madth3
  • 7,275
  • 12
  • 50
  • 74
Simon Epskamp
  • 8,813
  • 3
  • 53
  • 58
  • 2
    Could you post the less code in question that you are trying to compile? – Tigraine Feb 19 '12 at 00:20
  • Do you user absolute paths? Moving to relative could help. I use chirpy VS extension to compile and combine js/coffee and css/less files, you could give it a try – Guillaume86 Feb 23 '12 at 11:44

2 Answers2

3

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.

David Walschots
  • 12,279
  • 5
  • 36
  • 59
  • Awesome! You the man! Now to find out how to use Combres with a non-crippled dotless version. :) – Simon Epskamp Feb 23 '12 at 19:04
  • @Epskampie I assume you refer to the fact that Combres works with dotless 1.2.0.0 instead of 1.2.2.0? In that case, just update your reference (not via NuGet) to 1.2.2.0, and rewrite an assembly binding as follows: – David Walschots Feb 24 '12 at 08:16
  • Wow, that actually works! You just solved every problem i had with combres and dotless, thanks! – Simon Epskamp Feb 24 '12 at 13:38
1

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.

Paul Knopf
  • 9,568
  • 23
  • 77
  • 142
  • 1
    I know this is an old post, but the link to the fix is broken. Is there another location I can find the fix? – Dave B 84 Nov 10 '14 at 11:26