sass / libsass-net

A lightweight wrapper around libsass
MIT License
94 stars 35 forks source link

SourceCommentsMode should be bool #7

Closed vadimi closed 9 years ago

vadimi commented 9 years ago

In libsass version 3 source_comments property got changed from struct to simple bool (see sass_interface.h), so there is no need in SourceCommentsMode enum in libsass-net as well.

By the way, thanks for such quick migration to newest libsass :+1:

daveraine commented 9 years ago

Due to this change I can't get the latest NuGet package to work. It seems LibSassNet.Web is still expecting the struct. I get the following exception at runtime:

An exception of type 'System.MissingMethodException' occurred in System.Web.Optimization.dll but was not handled in user code

Additional information: Method not found: 'LibSassNet.CompileFileResult LibSassNet.ISassCompiler.CompileFile(System.String, LibSassNet.OutputStyle, System.String, LibSassNet.SourceCommentsMode, Int32, System.Collections.Generic.IEnumerable`1<System.String>)'.

Simply downloading the source code for LibSassNet.Web and compiling against LibSassNet.dll fixes the issue but would be great if the package can be updated.

darrenkopp commented 9 years ago

ah, good catch, looks like i forgot to update version on those. new packages have been deployed. sorry about that.

daveraine commented 9 years ago

Thanks for such a quick response. Unfortunately I am still having the same issue with the latest package.

darrenkopp commented 9 years ago

And you've verified the new dll's are in the bin directory and it's not one of those times where vs things that the dll is unchanged, but actually has?

daveraine commented 9 years ago

Yes, I definitely have the new dll in the bin directory. I've opened it in ILSpy and can see this line of code in the SassTransform class Process method:

string cSS = this.Compiler.CompileFile(text2, OutputStyle.Nested, null, 1, 5, new string[]
        {
            text
        }).CSS;

You can see it is passing the wrong parameters. Let me know if you need any more information.

darrenkopp commented 9 years ago

Yeah, I can't reproduce the problem on my end. Installing libsassnet.Web from nuget and running it works fine. Here's what i'd double check

  1. you have libsassnet.Web 1.7 in your packages directory
  2. the timestamps of the libsassnet.Web.dll file are the same in the bin directory as the nuget directory.

If ILSpy is returning that, it's the old dll. You might be able to force remove the dll and get fresh by uninstalling from nuget and then re-installing, but i'm guessing it's still using 1.6

daveraine commented 9 years ago

Sorry for being a pain! I've managed to reproduce this on a fresh project just now. I created a new MVC application, and added the Bootstrap.Sass and libsassnet.Web (not x64) packages.

I have the following in my BundleConfig:

bundles.Add(new SassBundle("~/sass/bootstrap").Include(
    "~/sass/bootstrap.scss"));

and in my _Layout.cshtml:

@Styles.Render("~/sass/bootstrap")

This has the same MissingMethodException. I've checked the dll in ILSpy again and it is the same as above. I can send you the project if that would help?

darrenkopp commented 9 years ago

interesting, yeah i get the same thing on x64. i'll have to look at whats broken in build script which is causing old dll's to go out

darrenkopp commented 9 years ago

alright, i got this figured out. expect an update tomorrow, i'm going to release libsass 3.0.1 as well as the fixes for this tonight.

darrenkopp commented 9 years ago

@daveraine ok, the new dll's pushed to nuget should resolve the issue you had.

daveraine commented 9 years ago

Great, working perfectly now, thanks.