Tagliatti / NetBarcode

Barcode generation library written in C# and .NET Standard 2
MIT License
337 stars 68 forks source link

DllNotFoundException: Unable to load DLL 'libgdiplus' on mac #9

Closed huxaiphaer closed 3 years ago

huxaiphaer commented 5 years ago

I really like this feature, but am using a mac and getting the error below :

System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found. at System.Runtime.InteropServices.FunctionWrapper`1.get_Delegate() at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output) at System.Drawing.SafeNativeMethods.Gdip..cctor() --- End of inner exception stack trace --- at System.Drawing.SafeNativeMethods.Gdip.GdipGetGenericFontFamilySansSerif(IntPtr& fontfamily) at System.Drawing.FontFamily.GetGdipGenericSansSerif() at System.Drawing.FontFamily.get_GenericSansSerif() at System.Drawing.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical) at NetBarcode.Barcode..ctor(String data) at ICFERApp.Controllers.StudentController.Details(Int64 id) in /Users/idrislutaaya/RiderProjects/ICFERApp/ICFERApp/Controllers/StudentController.cs:line 176 at lambda_method(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)

I also tried to install libgdiplus with this brew install mono-libgdiplus command , but it didn't workout. What caused this issue ?

Tagliatti commented 5 years ago

Unfortunately I have no idea of the error, nor do I have an MEC to test. The only alternative is for you to clone the project and investigate it if I found out that you can post here or submit a pull request.

huxaiphaer commented 5 years ago

Ok, let me try my best.

artmerlop commented 4 years ago

Ok, let me try my best.

@huxaiphaer did you fixed it?

huxaiphaer commented 4 years ago

It has been a long time, what I remember I used another lib @artmerlop

areee commented 4 years ago

I found a solution to resolve this error on Mac. Use Homebrew package manager and run these commands in Terminal:

brew update
brew install mono-libgdiplus
huxaiphaer commented 4 years ago

Thanks @areee , for the solution.