Comments (19)
After a bit of digging, it looks like it has to do with .netcore2 docker image and LibSassHost targeting dotnetcore1. Image simply doesn't have older framework libraries. That said, do you have plans on migrating to dotnetcore2 anytime soon?
from libsasshost.
Hello, Alexander!
I am running on .net core 2.0, can this be an issue?
.NET Core 2.0 is backward compatible with .NET Core 1.0.
from libsasshost.
There is somewhat similar issue described here: aspnet/aspnet-docker#261.
from libsasshost.
That said, do you have plans on migrating to dotnetcore2 anytime soon?
In the next 4-5 days I will try to release a new version.
from libsasshost.
Went through couple more troubleshooting scenarios:
- It does work on OSX on the developer machine (not new docker instance).
- Does work on Docker for Windows with Linuze Containers when application is published using self-contained deployment and specifying specific "debian-x64" as a runtime ID. Here is a command
dotnet publish -r "debian-x64"
So it looks that some DLLs are missing in pure netcore2.0 docker debian image which are included when self-contained publishing is used.
from libsasshost.
You have the following code in *.csproj
file?
<PropertyGroup>
<RuntimeIdentifiers>…;debian-x64</RuntimeIdentifiers>
</PropertyGroup>
from libsasshost.
@Taritsyn no, we don't have that. I'd like this project to be as generic as possible, so it can be deployed in any docker container (windows or linux). Specifying RuntimeIdentifiers is typically only for self-contained publishing which in turn increases the size of the whole docker image (same as specifying -r "debian-x64" during publish, it is an ok workaround for now and I'm glad it is working).
You can see the source code here: https://github.com/VirtoCommerce/vc-storefront-core/blob/dev/VirtoCommerce.Storefront/VirtoCommerce.Storefront.csproj
from libsasshost.
Hello, Alexander!
In version 1.1.0 added support of .NET Standard 2.0. In addition, LibSassHost.Native.debian-x64 package has been replaced by the LibSassHost.Native.linux-x64 package.
But it seems to me, that these changes will not help to solve your problem. You still need to add to *.csproj
file the following code:
<PropertyGroup>
<RuntimeIdentifiers>…;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
from libsasshost.
Awesome, I'll check it now!
from libsasshost.
It works perfectly now! No need for RuntimeIdentifiers or self-contained deployments. Thanks for the quick release.
from libsasshost.
Actually now I'm getting same error in windows container (it is windowsnano) and I have VC 2015 redist installed, any suggestions?:
Compiler error: System.TypeInitializationException: The type initializer for 'LibSassHost.SassCompiler' threw an exception. ---> LibSassHost.SassCompilerLoadException: During loading of Sass-compiler error has occurred.
Most likely it happened, because failed to load the native implementation of the LibSass library. Therefore, you need to choose and install the most appropriate NuGet package(s) for your platform. The following packages are available:
* LibSassHost.Native.win-x86
* LibSassHost.Native.win-x64
* LibSassHost.Native.debian-x64
* LibSassHost.Native.osx-x64 ---> System.DllNotFoundException: Unable to load DLL 'libsass': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at LibSassHost.Internal.Native.Sass_Api.libsass_version()
at LibSassHost.Internal.SassCompilerProxy.GetVersion()
at LibSassHost.SassCompiler..cctor()
--- End of inner exception stack trace ---
at LibSassHost.SassCompiler..cctor()
--- End of inner exception stack trace ---
at LibSassHost.SassCompiler.Compile(String content, CompilationOptions options)
from libsasshost.
Hello, Alexander!
It is possible, that the Visual C++ Redistributable for Visual Studio 2015 is not installed on the server.
from libsasshost.
Yeah, I think there is something wrong with installing VC redist on Windows Nano server, as the code below doesn't seem to be installing VC correctly. Is the DLL not included with a win nuget because of licensing restrictions?
Btw, below is my dockerfile i use to generate the package for windows.
# escape=`
# Build runtime image
FROM microsoft/aspnetcore:2.0
RUN Invoke-WebRequest "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe" -OutFile "c:\vc_redist.x64.exe"
RUN powershell start-process C:\vc_redist.x64.exe -ArgumentList '/quiet' -Wait
ARG SOURCE=VirtoCommerce.Storefront\bin\Debug\netcoreapp2.0\publish
WORKDIR /app
COPY $SOURCE .
ENTRYPOINT ["dotnet", "VirtoCommerce.Storefront.dll"]
from libsasshost.
Yeah, I think there is something wrong with installing VC redist on Windows Nano server, as the code below doesn't seem to be installing VC correctly.
Try to install through the Chocolatey or deploy the msvcp140.dll
assembly manually.
from libsasshost.
I copied msvcp140.dll
manually to c:\windows\system32
folder and now getting the following error:
Compiler error: System.TypeInitializationException: The type initializer for 'LibSassHost.SassCompiler' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at LibSassHost.Internal.Native.Sass_Api.libsass_version()
at LibSassHost.Internal.SassCompilerProxy.GetVersion()
at LibSassHost.SassCompiler..cctor()
--- End of inner exception stack trace ---
at LibSassHost.SassCompiler.Compile(String content, CompilationOptions options)
from libsasshost.
Ok, I think I resolved it by copying 2 64 bit libraries to windows\system32 folder just like this:
COPY libs\x64\msvcp140.dll c:\windows\system32
COPY libs\x64\vcruntime140.dll c:\windows\system32
from libsasshost.
In principle, these assemblies could be deployed locally (in the bin
directory of web application).
from libsasshost.
No bin folder in published version of .netcore2 and since it is docker image, it is fine to have it in that folder. Kinda odd though that system32 needs 64bit version of the dll.
from libsasshost.
Hello, Alexander!
Since version 1.2.6 the MSVC runtime was embedded into the native assemblies for Windows. Now you do not need to install the Microsoft Visual C++ Redistributable.
from libsasshost.
Related Issues (20)
- When used inside a Microsoft.Build.Framework.ITask, the whole process crashes if there's an SCSS error HOT 10
- request: non-static file manager HOT 6
- Unable to load DLL 'libsass' on Windows Server 2008 R2 HOT 2
- How to @import partials HOT 1
- SassСompilationException contains cyrillic character HOT 4
- [BUG] Upgrade to v1.3.1 adds `/c/` to paths HOT 7
- Combining a string of sass with an scss file HOT 5
- `@use` rule doesn't compile HOT 6
- application o virtual directory HOT 2
- On azure webapp getting "An attempt was made to load a program with an incorrect format" HOT 2
- Error: File to import not found or unreadable HOT 23
- LibSassBuilder HOT 2
- Support for Memory<char> as parameter and result CSS
- Sass Modules Support HOT 8
- .NET 6 on Apple Silicon HOT 7
- How to utilize with Blazor? HOT 2
- Updating System.Buffers in .Net Framework project breaks dll-mapping to libsasshost version HOT 2
- Calling from Powershell, cannot load dependent assemblies HOT 4
- Variables are not compiled when scss is compiled HOT 3
- The type initializer for 'LibSassHost.SassCompiler' threw an exception HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsasshost.