Posted 17 July 2023, 6:47 am EST
The package GrapeCity.ActiveReports.Core.Document.Drawing.Gdi has a requirement on System.Drawing.Common. This prevents running Section Reports within a Linux Docker Container.
The dependency on System.Drawing.Common appears to have been added back with version 4.x. With version 3.x, there was no dependency on System.Drawing.Common, but I’m running v17, which requires 4.x
Here’s the error:
2023-07-17 15:41:47 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2023-07-17 15:41:47 —> System.TypeInitializationException: The type initializer for ‘GrapeCity.ActiveReports.Document.Section.Page’ threw an exception.
2023-07-17 15:41:47 —> System.TypeInitializationException: The type initializer for ‘GrapeCity.ActiveReports.Core.Document.Drawing.Gdi.GdiTextLayoutService’ threw an exception.
2023-07-17 15:41:47 —> System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception.
2023-07-17 15:41:47 —> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
2023-07-17 15:41:47 at System.Drawing.LibraryResolver.EnsureRegistered()
2023-07-17 15:41:47 at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
2023-07-17 15:41:47 at System.Drawing.SafeNativeMethods.Gdip…cctor()
2023-07-17 15:41:47 — End of inner exception stack trace —
2023-07-17 15:41:47 at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, IntPtr scan0, IntPtr& bitmap)
2023-07-17 15:41:47 at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
2023-07-17 15:41:47 at System.Drawing.Bitmap…ctor(Int32 width, Int32 height)
2023-07-17 15:41:47 at GrapeCity.ActiveReports.Core.Document.Drawing.Gdi.GdiTextLayoutService…cctor()
2023-07-17 15:41:47 — End of inner exception stack trace —
2023-07-17 15:41:47 at GrapeCity.ActiveReports.Win.Services.GdiTextLayoutServiceFactory.Create()
2023-07-17 15:41:47 at GrapeCity.ActiveReports.Document.Section.Page…cctor()
2023-07-17 15:41:47 — End of inner exception stack trace —
2023-07-17 15:41:47 at GrapeCity.ActiveReports.Document.Section.Page…ctor()
2023-07-17 15:41:47 at System.RuntimeType.CreateInstanceOfT()
2023-07-17 15:41:47 — End of inner exception stack trace —
2023-07-17 15:41:47 at System.RuntimeType.CreateInstanceOfT()
2023-07-17 15:41:47 at System.Activator.CreateInstanceT
2023-07-17 15:41:47 at GrapeCity.ActiveReports.Core.Document.DocumentBase`1.CreatePage()
2023-07-17 15:41:47 at GrapeCity.ActiveReports.SectionReport.ProcessPage()
2023-07-17 15:41:47 at GrapeCity.ActiveReports.SectionReport.RunImpl(Boolean syncDocument)
2023-07-17 15:41:47 at GrapeCity.ActiveReports.SectionReport.Run(Boolean syncDocument)
2023-07-17 15:41:47 at GrapeCity.ActiveReports.SectionReport.Run()