Page 1 of 1

Exception when compile the report on a server

Posted: Mon Jan 17, 2022 12:09 pm
by hugo
Hi,

I suddenly started getting the following exception when compiling any report: Cannot create an abstract class

This happens in a server and don't happens on another server (the same application).

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 2:31 pm
by HighAley
Hello,

Can you send us the full message with stack?

Thank you.

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 3:16 pm
by hugo
The full exception (exception . toString()) that happens on this server:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Cannot create an abstract class. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at Reports.Report.InitializeComponent() at Reports.Report..ctor() --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at Stimulsoft.Report.StiReport.GetReportsFromAssembly(Assembly assembly) at Stimulsoft.Report.StiReport.GetReportFromAssembly(Assembly assembly) at Stimulsoft.Report.StiReport.CreateInstance(String path) at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate, Object standaloneReportType) at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate) at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType, Boolean autoCreate) at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType) at Stimulsoft.Report.StiReport.Compile(StiOutputType outputType) at Stimulsoft.Report.StiReport.Compile() at Stimulsoft.Report.StiReport.b__18_0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Stimulsoft.Report.StiReport.CompileAsync() at SolidSoft.Report.RenderReport.renderReport(String connectionString, StiReport report, Boolean showWatermark, List`1 data, List`1 parameters)

Another info: This run on .NET 5

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 3:21 pm
by hugo
This exception . StackTrace:

at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at Stimulsoft.Report.StiReport.GetReportsFromAssembly(Assembly assembly) at Stimulsoft.Report.StiReport.GetReportFromAssembly(Assembly assembly) at Stimulsoft.Report.StiReport.CreateInstance(String path) at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate, Object standaloneReportType) at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate) at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType, Boolean autoCreate) at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType) at Stimulsoft.Report.StiReport.Compile(StiOutputType outputType) at Stimulsoft.Report.StiReport.Compile() at Stimulsoft.Report.StiReport.b__18_0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Stimulsoft.Report.StiReport.CompileAsync() at SolidSoft.Report.RenderReport.renderReport(String connectionString, StiReport report, Boolean showWatermark, List`1 data, List`1 parameters)

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 3:21 pm
by hugo
This is urgent, please advice.

I updated .NET 5 on both servers and also try with an empty report.
Continue to work on one server and did not work on another.

I can't find stimulsoft .NET source code on my account to download and check deeper inside CompileAsync method.

Another point: All my reports came from a string with the report xml file: LoadFromString

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 6:28 pm
by hugo
I just found that this issue is related with the ZXing.Net.Bindings.CoreCompact.System.Drawing that was added to the project yesterday.
ZXing uses CoreCompact.System.Drawing.v2 and Stimulsoft uses System.Drawing.Common. Probably came from here the issue even don't happen in development environment and happen on one server and not another.

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 7:53 pm
by hugo
You can close this issue.
I found an alternative to ZXing.Net.Bindings.CoreCompact.System.Drawing and the incompatibility was workarounded.

Re: Exception when compile the report on a server

Posted: Mon Jan 17, 2022 8:19 pm
by HighAley
Hello,

Great!
Let us know if you need any additional help.

Thank you.