Error when using ConvertHTML in web application

I’m converting an html file to pdf, using the code below. This code works fine in a console application. When I run the same code in a .NET Framework 4.8 web application, the app pool recycles and an Event Log message is written: Application popup: w3wp.exe - System Error : A new guard page for the stack cannot be created.

        using (HTMLDocument htmlDocument = new HTMLDocument(htmlFileName))
        {
            Aspose.Html.Saving.PdfSaveOptions pdfOptions = new Aspose.Html.Saving.PdfSaveOptions();
            Aspose.Html.Converters.Converter.ConvertHTML(htmlDocument, pdfOptions, pdfFileName);
        }

@dbartle

Could you please share a sample web application with us which is able to reproduce the issue? We will test the scenario in our environment and address it accordingly.

@dbartle

We were able to notice StackOverFlow exception while testing the scenario in our environment. Therefore, have logged an issue as HTMLNET-3028 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Curious if there is any update on this issue?

@dbartle

We are afraid that the earlier logged ticket is not yet resolved. We will surely fix the logged issue on a first come first serve basis and let you know as soon as certain progress is made towards its resolution. Please be patient and give us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as HTMLNET-3028) have been fixed in this update. This message was posted using Bugs notification tool by pavel.petrushechkin

I am using version 22.11, which handles most files but we have encountered one that produces the same behavior, recycling the app pool.

A related issue here Error when using ConvertHTML in web application was logged, that crashes the app pool. The fix was applied and seems to fix many cases, but there still exists some HTML files that crash the app pool.NewCrashFromMsg.zip (51.8 KB)

@dbartle

Would you kindly try to use 23.1 version of the API as it is the latest one. In case issue still persists, please let us know.

Yes I’ve reproduced with these versions:

<Reference Include="Aspose.Email, Version=23.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
  <HintPath>packages\Aspose.Email.23.1.0\lib\net45\Aspose.Email.dll</HintPath>
</Reference>
<Reference Include="Aspose.HTML, Version=23.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
  <HintPath>packages\Aspose.HTML.23.2.0\lib\net40\Aspose.HTML.dll</HintPath>
</Reference>

@dbartle

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-4287

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.