Not working with .NET Core 3 on Alpine Linux
See original GitHub issueAfter updating to .NET Core 3 and latest NuGet package, I get the following error:
{
"Depth": 0,
"ClassName": "System.TypeInitializationException",
"Message": "The type initializer for 'NativeMagickSettings' threw an exception.",
"Source": "Magick.NET-Q8-AnyCPU",
"StackTraceString": " at ImageMagick.MagickSettings.NativeMagickSettings..ctor()\n at ImageMagick.MagickSettings..ctor()\n at ImageMagick.MagickImage..ctor()\n at ImageMagick.MagickImage..ctor(Stream stream)\n at Reshopper.Controllers.MediaController.RedirectToImage(String filePath) in /src/Reshopper/Controllers/MediaController.cs:line 31\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\n at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"HResult": -2146233036,
"HelpURL": null,
"innerException": {
"Depth": 1,
"ClassName": "System.DllNotFoundException",
"Message": "Unable to load shared library 'Magick.Native-Q8-x64.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libMagick.Native-Q8-x64.dll: No such file or directory",
"Source": "Magick.NET-Q8-AnyCPU",
"StackTraceString": " at ImageMagick.Environment.NativeMethods.X64.Environment_Initialize()\n at ImageMagick.Environment.NativeEnvironment.Initialize()\n at ImageMagick.Environment.Initialize()\n at ImageMagick.MagickSettings.NativeMagickSettings..cctor()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"HResult": -2146233052,
"HelpURL": null
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Install the .NET SDK or the .NET Runtime on Alpine
Demonstrates the various ways to install .NET SDK and .NET Runtime on Alpine.
Read more >.NET core console app will not start in docker image based ...
I'm pretty sure the issue is with this line: RUN dotnet publish "MyProject.csproj" -c Release -o /app/publish --no-restore.
Read more >Missing symbols for dotnet core 3.1 (#14116) - alpine · GitLab
I would like to be able to install and run the Microsoft Azure DevOps Agent software on a container running Alpine.
Read more >Hosting Aspose dotnetcore 3.1 in Alpine Linux container is ...
1 in an Alpine based container I get the following error message when converting any type of Aspose files (I have tried both...
Read more >Running ASP.NET Core in an Alpine Linux Docker Container
The error here is that the debian docker image we are using doesn't have the nightly version of the 2.1 runtime installed and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, but I don’t have the time. I’m sure a sample asp.net core app using docker would demonstrate it though!
For me it, this issue appeared again with the mcr.microsoft.com/dotnet/core/aspnet:5.0-alpine image.