Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:14:03+00:00 2026-06-12T10:14:03+00:00

ASP.Net MVC4 + Bootstrap (LESS) + dotLess. Goal is to transform the Bootstrap .less

  • 0

ASP.Net MVC4 + Bootstrap (LESS) + dotLess.

Goal is to transform the Bootstrap .less files into a single bundle of .css, and I’m running into showstopper issues.

Bundle.config

var bootstrapStyles = new Bundle("~/bundle/style/bootstrap").Include("~/Content/less/*.less");
bootstrapStyles.Transforms.Add(new LessTransform());
bootstrapStyles.Transforms.Add(new CssMinify());
bundles.Add(bootstrapStyles);

Only bootstrap’s less files, which should not have any red-flag syntax problems.

The next step was to build that transformer class LessTransform to produce the css.

The transformer class implements the Process() and the problematic code exists inside… here’s both scenarios and their problems:

Scenario 1: Static Less.Parse()

var parsedLess = Less.Parse(bundle.Content);
bundle.Content = parsedLess;

// Throws a FileNotFoundException
// "You are importing a file ending in .less that cannot be found."
// reset.less and it definitely exists in that folder. 

Scenario 2: LessEngine.TransformToCss()

var content = new StringBuilder();
var engine = new LessEngine();

foreach (var file in bundle.Files)
{
    // text is extracted correctly.
    var text = File.ReadAllText(file.FullName);
    // transform function returns an empty string, no errors
    var css = engine.TransformToCss(text, file.FullName);
    content.AppendLine(css);
}
bundle.Content = content.ToString();

Question

Anyone have an insight on either of these errors? Know any solutions? Neither make sense to me. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:14:04+00:00Added an answer on June 12, 2026 at 10:14 am

    Wow! That’s a lot of hoop jumping to find the source of the problem.

    A good strategy for such problems is to peel away the layers to the simplest case. You’re not seeing any error messages because something in the bundling process is eating up dotless’s logging messages, which should be dealt with separately. This assumes you have dotless error logging turned on.

    Instead, of using:

    @Styles.Render(“~/bundle/style/bootstrap”)

    use

    <link rel="stylesheet/less" href="~/Content/style/bootstrap.less" type="text/css" />
    

    When you try to view the less file in the browser, you should get the following message:

    directive block with unrecognised format on line 253 in file
    ‘/Content/Themes/bootstrap/mixins.less’:

    [252]: // Multiple shadow solution from
    http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
    [253]: @props: ~"@{arguments}".replace(/[\[\]]|\,\sX/g, '');
    –^ [254]: -webkit-box-shadow: @props;

    The source of this problem is attributed to a hack in bootstrap that doesn’t play well with dotless. To fix this problem, replace the following lines in mixins.less:

    // Drop shadows
    .box-shadow(@shadowA, @shadowB:X, ...){
      // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
      @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
      -webkit-box-shadow: @props;
         -moz-box-shadow: @props;
              box-shadow: @props;
    }
    

    with the following lines:

    // Drop shadows
    .box-shadow(@shadow){
      -webkit-box-shadow: @shadow;
         -moz-box-shadow: @shadow;
              box-shadow: @shadow;
    }
    .box-shadow(@shadow1, @shadow2) {
      -webkit-box-shadow: @shadow1, @shadow2;
         -moz-box-shadow: @shadow1, @shadow2;
              box-shadow: @shadow1, @shadow2;
    }
    .box-shadow(@shadow1, @shadow2, @shadow3) {
      -webkit-box-shadow: @shadow1, @shadow2, @shadow3;
         -moz-box-shadow: @shadow1, @shadow2, @shadow3;
              box-shadow: @shadow1, @shadow2, @shadow3;
    }
    

    Hope this works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm researching the new ASP.NET MVC4 Web API framework. I'm running Visual Studio 2011
I'm trying the get the mini profiler for RavenDb running in my ASP.NET MVC4
Using ASP.NET MVC4 with EF4.3 Running Enable-Migrations from PM Console System.Management.Automation.RuntimeException: The project 'MyProj'
I created an ASP.NET MVC4 Web API service (REST) with a single GET action.
I have created a Single Page Application (ASP.NET MVC4) using Steven Sanderson's instructions .
I am using KnockoutJS and Bootstrap in ASP.NET MVC4 to display image thumbnails. The
In ASP.net MVC4 there's this 'new' concept of a web API for exposing CRUD
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I have a simple asp.net MVC4 / EF 4.1 project created with VS 2011,
I have an ASP.NET MVC4 site with mobile content. When I deploy this on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.