|
Rank: Member Groups: Member
Joined: 2/21/2020 Posts: 10
|
Hi,
we use EO.PDF on an ASP.NET CORE project (.NET 5.0). We have exceptions on some requests, at random intervals.
The exception in question is the following:
FullName : System.NullReferenceException Message : Object reference not set to an instance of an object. Source : EO.Pdf.Mvc Stacktrace : at EO.Pdf.Mvc.MVCToPDF.vhhm() at EO.Pdf.Mvc.Emit.Filter.IResultFilter.OnResultExecuted(ResultExecutedContext ) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
We had this problem on version 21.1.11.0, so we updated to the latest version 21.1.67, but the problem is still there.
How can we fix this problem?
Best regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, We are not aware of such issue. Is it possible for you to isolate the issue in a test project and send the test project to us? See here for more details: https://www.essentialobjects.com/forum/test_project.aspxThanks!
|
|
Rank: Member Groups: Member
Joined: 2/21/2020 Posts: 10
|
Hi,
I isolated the problem in a small ASP.NET CORE sample project (.NET 5.0). I sent you this project for testing.
it seems to come from this line in the Startup.cs file : services.AddMvc(options => { EO.Pdf.Mvc.MVCToPDF.RegisterFilterAspNetCore(options); });
When we remove "EO.Pdf.Mvc.MVCToPDF.RegisterFilterAspNetCore(options);" the project's web pages work correctly without generating exceptions (but you can't use EO.PDF.MVC to convert web pages to PDF anymore).
The exception seems to be when you have a lot of text on a page. I could see that if the webpage size is more than 7 KB it generates an exception, if the webpage is less than 7 KB it doesn't generate an exception.
Maybe this information will help you find the problem.
Best regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Thanks for very much for your test files. We have looked into this and the root of the problem is the current version does not support async handler and Razor pages (which uses async handlers). We will change our code to support this in our next build.
We will reply here again when the new build is ready.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is just to let you know that we have posted a new build (21.1.93) that should resolve this issue. Please take a look and let us know how it goes.
Thanks!
|
|