Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up NSASS in production environment?

we are using NSASS to compile our Sass files to css ( https://github.com/TBAPI-0KA/NSass ). NSASS is set up and working great in development environment. But when we try to deploy it to our testserver we are unable to get NSASS up and running.

We keep getting

Exception information: 
Exception type: FileNotFoundException 
Exception message: Could not load file or assembly 'NSass.Wrapper.x64.dll' or one of its dependencies. The specified module could not be found.
   at NSass.SassCompiler..ctor()
   at NSass.SassHandler..ctor()

The problem is that NSASS uses some dynamic way to load these dlls, that does not seem to work. The dll is located in \bin\NSass.Wrapper but fuslogvw is logging that it only tries to search the bin directory. The dynamic way of loading this dll is made so that it loads the x86 or x64 depending on the OS if I understand correctly.

For the bin loading code of NSASS: https://github.com/TBAPI-0KA/NSass/blob/master/NSass.Core/AssemblyResolver.cs

I have tried moving the dll files (both X64 and x86) to bin folder but I get the same error looking in event viewer even if the fuslogvw says that all is ok.

Anyone have any tips on what I can do as a next step to try and solve this?

Edit: Tried logging AppDomain.CurrentDomain.SetupInformation.PrivateBinPath and it points to the bin folder as it should and AppDomain.CurrentDomain.BaseDirectory points to the correct folder aswell. Not sure if anything change the CurrentDomain from Application_Start where I log until the Assembly Load of the NSASS files.

Also worth noting. This is an EPiServer web so not sure if EPiServer changes anything. But if so shouln't it be problems in the Dev environment as well?

like image 678
JohanSellberg Avatar asked Apr 07 '14 09:04

JohanSellberg


1 Answers

I finally found the issue!

After using DependencyWalker to analyze the dlls of NSASS I found that the server did not have the correct version of C++ Redistriburable.

So after installing that all works fine!

Hope this helps other people with the same issue.

like image 128
JohanSellberg Avatar answered Oct 07 '22 02:10

JohanSellberg