Issue running stimulsoft in Linux with .net 6

Stimulsoft Reports.WEB discussion
web@egritosgroup.gr
Posts: 9
Joined: Thu May 09, 2019 9:37 pm

Issue running stimulsoft in Linux with .net 6

Post by web@egritosgroup.gr »

Hello,

I run my app that uses stimulsoft in Linux. After updating to .net 6 I get this error.

Exception has been thrown by the target of an invocation.The type initializer for 'Gdip' threw an exception.System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information

stackTrace
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
at Stimulsoft.Base.StiActivator.CreateObject(Type type)
at Stimulsoft.Base.Serializing.StiSerializing.GetObjectFromType(String typeStr)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(XmlTextReader tr, String parentPropName)
at Stimulsoft.Base.Serializing.StiSerializing.Deserialize(Object obj, Stream stream, String application)
at Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load(StiReport report, Stream stream)
at Stimulsoft.Report.StiReport.Load(StiReportSLService service, Stream stream)
at Stimulsoft.Report.StiReport.Load(Stream stream)
at Stimulsoft.Report.StiReport.Load(String path)

Is there any fix for this error?
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue running stimulsoft in Linux with .net 6

Post by Lech Kulikowski »

Hello,

Starting with .Net6, the GDI+ library will only be supported on Windows.
So the System.Drawing.Common package will no longer be included in NetCore for Unix systems.
On Unix systems, you can still install the separate Nuget package System.Drawing.Common from .Net5.
But starting with Net7 it seems this won't work either, just throwing a PlatformNotSupportedException.
here is a link to an article by the dotnet authors:
https://github.com/dotnet/designs/blob/ ... in-only.md

Thank you.
web@egritosgroup.gr
Posts: 9
Joined: Thu May 09, 2019 9:37 pm

Re: Issue running stimulsoft in Linux with .net 6

Post by web@egritosgroup.gr »

Hello,

I will try installing the separate nugget. I purchased stimulsoft in the past because it was the first .net core report engine working on Linux.
What are you plans about this issue? Shouldn't you make an official announcement about it, with your future plans?

Thank you
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue running stimulsoft in Linux with .net 6

Post by Lech Kulikowski »

Hello,

Yes, we are working on that task right now. The solution will be provided as fix build as fas as possible.

At the current moment, you can use the solution from the previous post.

Thank you.
web@egritosgroup.gr
Posts: 9
Joined: Thu May 09, 2019 9:37 pm

Re: Issue running stimulsoft in Linux with .net 6

Post by web@egritosgroup.gr »

Hello

Do you have any update on this issue? I couldn't find anything in release notes.
Is System.Drawing.Common replaced?

Do we still need the "hack" with the System.Drawing.EnableUnixSupport?
https://www.stimulsoft.com/en/blog/arti ... ting-tools
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue running stimulsoft in Linux with .net 6

Post by Lech Kulikowski »

Hello,

We work hard on this problem and do our best to do it as fast as possible. We will let you know when the solution is available.

Thank you.
anjung
Posts: 11
Joined: Sun Nov 15, 2020 12:10 pm

Re: Issue running stimulsoft in Linux with .net 6

Post by anjung »

Fixed in .NET 6 AspNetCore WebApi with

AppContext.SetSwitch("System.Drawing.EnableUnixSupport",true);

the runtimeconfig.json did not work for us
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue running stimulsoft in Linux with .net 6

Post by Lech Kulikowski »

Hello,

Thank you for the information.
danvy
Posts: 1
Joined: Mon May 23, 2022 12:31 pm

Re: Issue running stimulsoft in Linux with .net 6

Post by danvy »

Hello Lech,
Do you have any update on this issue ?
The EnableUnixSupport is not longer supported in .net 7 https://docs.microsoft.com/en-us/dotnet ... ded-action

Alex
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue running stimulsoft in Linux with .net 6

Post by Lech Kulikowski »

Hello,

Yes. We make our new own library. It will be available in the next major release 2022.3.1 in June.

Thank you.
Post Reply