This project has moved and is read-only. For the latest updates, please go here.

sass files are not rendered in output css file

May 12, 2015 at 11:52 AM
hi, iam trying to use this lib with sass and scss plugin but in the result css render i see only other css, nothing of scss files is rendered


this is my config class in app_code
public class BundleConfig
{
    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/Scripts/Bundles/WebFormsJs").Include(
            "~/Scripts/jquery-{version}.min.js",
            "~/Scripts/jquery-ui-{version}.min.js",
            "~/Scripts/jquery.cookie.js",
            "~/Scripts/utility.js",
            "~/Scripts/validator.js"));

        var cssTransformer = new CssTransformer();
        var jsTransformer = new JsTransformer();
        var nullOrderer = new NullOrderer();
        
        var css = new Bundle("~/Style/Bundles/css").Include("~/Style/Sass/application.sass", "~/Content/themes/base/base.css");
        css.Transforms.Add(cssTransformer);
        css.Orderer = nullOrderer;

        bundles.Add(css);

        BundleTable.EnableOptimizations = true;
    }
}
this is global.asax:
void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        BundleConfig.RegisterBundles(BundleTable.Bundles);          log4net.Config.XmlConfigurator.Configure(ProgettoAttivitaCommons.Logging.Log4jConfiguration.Instance("ProgettoAttivitaBL"));
    }
this is application.scss:
@import "Pages/__pages";
@import "Modules/__modules";
@import "External/__external";
body{color:red;}
p{font-size:larger;}
and the include in aspx file:

<%# Styles.Render("~/Style/Bundles/css") %>
with this in the top of the page:

<%@ Import Namespace="System.Web.Optimization" %>
May 12, 2015 at 1:48 PM
lol, i include file as .sass instead of .scss

since i see no error i think thats the file was found :)
May 12, 2015 at 3:48 PM
Hello, ms_sauron!

Since the problem has resolved itself, then I can delete this discussion?
May 12, 2015 at 8:13 PM
ok, can only ask if there is a way to be alerted if added file is not found? (like in the case i fell into) thanks
May 13, 2015 at 9:33 AM
Unfortunately, it is not possible, because primary file processing occurs at level of the Microsoft ASP.NET Web Optimization Framework. Bundle Transformer is already receiving a set of files without a nonexistent files.
May 13, 2015 at 1:17 PM
uh... ok, lets hope ms fix it then.

so you can delete, (or leave only last question if you think can help)

Hi and thanks for quick reply
May 13, 2015 at 1:28 PM
Most likely, Microsoft will not fix this error (see “Future of the Microsoft ASP.NET Web Optimization Framework” discussion). Microsoft recommends switch to Grunt or Gulp.

I collected useful materials, that will facilitate this switching.