Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Drawing Dependency issue on Apple Silicon M1 #573

Closed
cigoic opened this issue Jan 7, 2022 · 9 comments
Closed

System.Drawing Dependency issue on Apple Silicon M1 #573

cigoic opened this issue Jan 7, 2022 · 9 comments

Comments

@cigoic
Copy link

cigoic commented Jan 7, 2022

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
Copy link
Contributor

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
Copy link

@cigoic
Copy link
Author

cigoic commented Jan 20, 2022

@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
Copy link

@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
Copy link
Author

cigoic commented Jan 20, 2022

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

  • brew install dotnet-sdk mono-libgdiplus
  • .NET 6 ARM-based SDK 6.0.101 [/usr/local/share/dotnet/sdk]
  • NuGet Packages: EPPlus v5.8.5
  • NuGet Packages: runtime.osx.10.10-x64.CoreCompat.System.Drawing v6.0.5.128

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
Copy link
Contributor

@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
Copy link
Contributor

This should now work with version 6.0.3

@argentini
Copy link

@JanKallman nope, not even with 6.0.5

@mapquintal
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants