Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

We had the same issue but the fix ended up being two things.

  1. Installing Visual C++ Redistributable Packages for Visual Studio 2013 onto our servers. can be downloaded here

  2. Changing our compiler to libsass-net using nuget, it seems very similar to NSass (github).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top