Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF - ASP.NET CORE - Exception with EO.Pdf.Mvc Options
aurelsa
Posted: Sunday, July 18, 2021 5:26:44 AM
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
Jack Cheng
Posted: Sunday, July 18, 2021 3:28:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
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.aspx

Thanks!
aurelsa
Posted: Wednesday, July 21, 2021 8:13:35 AM
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
Jack Cheng
Posted: Thursday, July 22, 2021 11:17:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
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.
Jack Cheng
Posted: Thursday, July 29, 2021 2:59:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.