EPPlusSoftware / EPPlus

EPPlus-Excel spreadsheets for .NET
https://epplussoftware.com
Other
1.8k stars 274 forks source link

System.Drawing Dependency issue on Apple Silicon M1 #573

Closed cigoic closed 2 years ago

cigoic commented 2 years ago

Similar issue related to this:

https://supportcenter.devexpress.com/ticket/details/t1047142/the-libgdiplus-library-cannot-be-loaded-on-an-apple-m1-arm-based-machine-with-mac-os

There is a closed issue here but not works for EEPlus v5.8.4 + M1 + VS 2022 for Mac.

Any suggestions?

Thanks. Screen Shot 2022-01-07 at 9 05 56 PM

JanKallman commented 2 years ago

As EPPlus is currently depending on System.Drawing.Common, so we likely have the same issue. However, we are currently working on replacing System.Drawing.Common with a native solution for text measuring and images. It will also have a fall back on SkiaSharp or System.Drawing.Common. We hope we can release it in the next version (available in a month or two).

SymbioticKilla commented 2 years ago

@cigoic You can try "System.Drawing.EnableUnixSupport": true From here: https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only Or add a nuget package: https://stackoverflow.com/questions/61671871/how-to-use-system-drawing-on-mac-os

cigoic commented 2 years ago

@cigoic You can try "System.Drawing.EnableUnixSupport": true From here: https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only Or add a nuget package: https://stackoverflow.com/questions/61671871/how-to-use-system-drawing-on-mac-os

Thanks, @SymbioticKilla

The solutions above seem to work fine using x86-version .NET 6 SDK but not the latest arm-version.

I put a runtimeconfig.template.json with the configuration to set up "System.Drawing.EnableUnixSupport": true. But it does not work.

SymbioticKilla commented 2 years ago

@cigoic You can try "System.Drawing.EnableUnixSupport": true From here: https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only Or add a nuget package: https://stackoverflow.com/questions/61671871/how-to-use-system-drawing-on-mac-os

Thanks, @SymbioticKilla

The solutions above seem to work fine using x86-version .NET 6 SDK but not the latest arm-version.

I put a runtimeconfig.template.json with the configuration to set up "System.Drawing.EnableUnixSupport": true. But it does not work.

Have you installed libgdiplus? If I understand correctly nuget just gives the location of it: s://github.com/CoreCompat/libgdiplus-packaging/blob/master/runtime.osx.10.10-x64.CoreCompat.System.Drawing/runtime.osx.10.10-x64.CoreCompat.System.Drawing.csproj

cigoic commented 2 years ago

Yes. I have the following items installed on my M1 mbp:

I tried the same code with VS 2019 for Mac (x86-based .NET SDK) and it works fine.

But it will not work under VS 2022 for Mac Preview (arm-based .NET 6 SDK) with/without runtime.osx.10.10-x64.CoreCompat.System.Drawing installed.

Adding the runtimeconfig.template.json does not change anything in my case, unfortunately.

JanKallman commented 2 years ago

@cigoic, @SymbioticKilla - You should try latest EPPlus 6.0.1-beta available on Nuget. It will work without the dependency on libgdiplus. See https://www.epplussoftware.com/en/Developers/EPPlus6

JanKallman commented 2 years ago

This should now work with version 6.0.3

argentini commented 2 years ago

@JanKallman nope, not even with 6.0.5

mapquintal commented 1 year ago

Try install nuget package Curiosity.runtime.osx.10.10-arm64.CoreCompat.System