FastReports / FastReport

Free Open Source Reporting tool for .NET6/.NET Core/.NET Framework that helps your application generate document-like reports

Home Page:https://www.fast-report.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastReport Open Source support for .Net 7 on Linux (Non-Windows)

rjs123431 opened this issue · comments

Describe the bug
System.Drawing.Common is not supported in Linux. For .Net 6.0, there is a workaround to it but it was removed in .Net 7.0

Workaround in .Net 6.0 is to add it runtimeconfig.template.json

{
   "configProperties": {
      "System.Drawing.EnableUnixSupport": true
   }
}

To Reproduce

  1. Add FastReport to the project and call app.UseFastReport()
  2. Deploy the project in linux system (App Service for Linux or Linux Docker)

Expected behavior
It should support non-windows

Stacktrace
FATAL 2023-02-22 07:04:17,841 [1 ] Microsoft.AspNetCore.Hosting.Diagnostics - Application startup exception
System.TypeInitializationException: The type initializer for 'FastReport.Utils.Config' threw an exception.
---> System.TypeInitializationException: The type initializer for 'FastReport.TypeConverters.FontConverter' threw an exception.
---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
at System.Drawing.Text.FontCollection..ctor()
at System.Drawing.Text.PrivateFontCollection..ctor()
at FastReport.TypeConverters.FontConverter..cctor()
--- End of inner exception stack trace ---
at FastReport.TypeConverters.FontConverter.get_PrivateFontCollection()
at FastReport.Utils.FRPrivateFontCollection..ctor()
at FastReport.Utils.Config..cctor()
--- End of inner exception stack trace ---
at FastReport.Utils.Config.set_WebMode(Boolean value)
at Microsoft.AspNetCore.Builder.FastReportBuilderExtensions.UseFastReport(IApplicationBuilder app, Action`1 setupAction)

commented

have you tried using FastReport.Core.Skia package? This removes the dependency on System.Drawing https://www.fast-report.com/en/blog/show/fastreport-core-skia/

FastReport.Core.Skia

Not yet available for FastReport OpenSource

Hi. Will it be added at all?

Hello!

Wait for FastReport.Core.Skia Demo to release to solve your problems

Best regards,
Bogdan