Page 1 of 2

Issue running stimulsoft in Linux with .net 6

Posted: Sun Nov 14, 2021 7:07 pm
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?

Re: Issue running stimulsoft in Linux with .net 6

Posted: Mon Nov 15, 2021 11:14 pm
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.

Re: Issue running stimulsoft in Linux with .net 6

Posted: Tue Nov 16, 2021 7:11 am
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

Re: Issue running stimulsoft in Linux with .net 6

Posted: Wed Nov 17, 2021 7:20 am
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.

Re: Issue running stimulsoft in Linux with .net 6

Posted: Mon Jan 31, 2022 4:48 pm
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

Re: Issue running stimulsoft in Linux with .net 6

Posted: Wed Feb 02, 2022 9:36 pm
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.

Re: Issue running stimulsoft in Linux with .net 6

Posted: Tue Mar 01, 2022 8:51 am
by anjung
Fixed in .NET 6 AspNetCore WebApi with

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

the runtimeconfig.json did not work for us

Re: Issue running stimulsoft in Linux with .net 6

Posted: Tue Mar 01, 2022 10:26 am
by Lech Kulikowski
Hello,

Thank you for the information.

Re: Issue running stimulsoft in Linux with .net 6

Posted: Mon May 23, 2022 12:35 pm
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

Re: Issue running stimulsoft in Linux with .net 6

Posted: Wed May 25, 2022 7:19 am
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.