Exception when compile the report on a server

Stimulsoft Reports.NET discussion
Post Reply
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Exception when compile the report on a server

Post 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).
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception when compile the report on a server

Post by HighAley »

Hello,

Can you send us the full message with stack?

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Exception when compile the report on a server

Post 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
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Exception when compile the report on a server

Post 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)
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Exception when compile the report on a server

Post 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
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Exception when compile the report on a server

Post 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.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Exception when compile the report on a server

Post by hugo »

You can close this issue.
I found an alternative to ZXing.Net.Bindings.CoreCompact.System.Drawing and the incompatibility was workarounded.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception when compile the report on a server

Post by HighAley »

Hello,

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

Thank you.
Post Reply