sass / libsass-net

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

Could not load file or assembly 'LibSass.x86.DLL' or one of its dependencies. The specified module could not be found. #36

Closed ad0ran closed 8 years ago

ad0ran commented 8 years ago

I have an asp.net web project and have installed the following packages:

libsassnet v3.2.5.1 libsassnet.Web v2.1.3.1

I also have my bundles configured like so: bundles.Add(new SassBundle("~/bundles/sass/bootstrap").Include("~/sass/bootstrap.scss"));

When I compile the project, I see that the LibSass.x86.dll is located in my bin folder, so I am unsure of why it's unable to load the assembly.

aviatrix commented 8 years ago

Most likely you are building against "Any CPU" which causes the build to be x64, and you have installed the x86 versions of the package. Please install LibSassNet x64

Install-Package libsassnet.Web.x64 Install-Package libsassnet.x64

ad0ran commented 8 years ago

I tried rebuilding against the x86 Platform Target, still experiencing the same issue

ad0ran commented 8 years ago

After installing the x64 packages, i start to receive this error:

Could not load file or assembly 'LibSass.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.

aviatrix commented 8 years ago

are you building against X64 after you installed the X64 packages?

ad0ran commented 8 years ago

Yes

ad0ran commented 8 years ago

I also have Microsoft Visual C++ 2013 Redistributable installed as well. (also 2008 - 2012)

treefishuk commented 8 years ago

Same problem here... I have tried reinstalling the Visual Studio 2013 C++ Redistribution packages and have had no joy. If I go to : Tools > Options > Projects and Solutions > Web Projects and un-check 'Use the 64bit version of IIS Express' it builds the site in 32bit and finds the 32bit dll fine, but I need it to build as 64bit.

aviatrix commented 8 years ago

@ad0ran @treefishuk Could you try installing a bit older version of the packages ? 1,2 or 3 versions back and report the results?

ad0ran commented 8 years ago

I installed libsassnet.web 1.1.0 and build against x86 platform, still receiving the same issue.

aviatrix commented 8 years ago

are you runnign IIS or IIS Express?

ad0ran commented 8 years ago

IIS Express

aviatrix commented 8 years ago

try IIS proper running as local system

ad0ran commented 8 years ago

I enabled local IIS and published to filesystem. I then setup the my local iis bindings, but still the same issue. i created a repository for the project i'm working on, you can view my source here: https://github.com/ad0ran/AngularJS

aviatrix commented 8 years ago

@ad0ran project > properties > web > "use local iis" > create virtual directory > ctrl+s (just in case make your project run as x64 in bundleconfig.cs change to bundles.Add(new SassBundle("~/bundles/css/bootstrap").Include("~/sass/bootstrap.scss")); and remove the web compiler thingy that also compiles scss to css to avoid conflicts

ad0ran commented 8 years ago

@aviatrix

Hi yes, I changed the virtual directory to point to the web project instead of the published source. I've also installed the x64 packages and have compiled towards the x64 platform. I'm not receiving anymore runtime errors, but loading the web page takes unusually longer now.

aviatrix commented 8 years ago

@ad0ran sometimes you will have to restart IIS , cmd as administrator > iisreset if it takes more than ~30 seconds, do a reset. it's a known issue that we haven't quite been able to fix yet

aviatrix commented 8 years ago

@treefishuk ping, please read above :)

ad0ran commented 8 years ago

@aviatrix

I see, alright thanks for your help. Keep up the good work!

AshishShukla16 commented 6 years ago

I am using visual studio 2017 version 15.7.3 and using both the 64 and 86 dll versions. I have tried all the solutions mentioned above but same is not working for me. I am using libsasshost version 1.1.9.0 and getting the below error: 'Unable to load DLL 'libsass': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))'