Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After migrating from ASP.NET Core 2.0 to 2.1, libsass.dll is no longer copied to output folder on build #13

Open
oculys-andrew opened this issue Dec 30, 2019 · 0 comments

Comments

@oculys-andrew
Copy link

I have an ASP.NET Core 2.0 web app (running on .NET Framework 4.6.1) using WebOptimizer.Sass, and after updating the project to ASP.NET Core 2.1 it would no longer drop libsass.dll in the output folder on build, and because of that I got runtime errors when a browser tried to access a CSS file that's supposed to be generated from SCSS. I tried updating to .NET Framework 4.7.2, but saw no change.

Brief stack trace:

System.DllNotFoundException: Unable to load DLL 'libsass': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at SharpScss.LibSass.sass_alloc_memory(size_t size)
   at SharpScss.LibSass.StringUtf8.op_Implicit(String text)
   at SharpScss.Scss.FromCore(String fromStringOrFile, Boolean fromFile, ScssOptions options)
   at WebOptimizer.Sass.Compiler.ExecuteAsync(IAssetContext context)
   at WebOptimizer.Asset.<ExecuteAsync>d__22.MoveNext()

As a workaround, if I install the SharpScss package directly on the project via NuGet (instead of leaving it as a nested dependency under WebOptimizer.Sass), then libsass.dll is indeed dropped in the output folder. (Though when building for AnyCPU, with the csproj not specifying a PlatformTarget, it would drop the 64-bit libsass.dll while the project would be built for x86, so I did have to update the project settings to explicitly target x64.)

I'm fine with that workaround for the time being, but I figured you might want to know about this issue since ASP.NET Core 2.1 is an LTS version, and also this way the workaround is documented/findable for others who need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant