Home > Software engineering >  Rotativa with Asp.net Core 5
Rotativa with Asp.net Core 5

Time:06-16

Please I need your help on this issue that I'm facing since 2 days now. I'm using Rotativa.AspNetCore to export view in pdf with asp.net core 5, my code is working fine from visual studio 2019 but when I publish the app I'm getting this error:

Error. An error occurred while processing your request. Request ID: 00-4b8009f0978a2748b2467f7601bf7758-4639da00167d8849-00

Development Mode Swapping to Development environment will display more detailed information about the error that occurred. The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

here is my code:

  public async Task<IActionResult> RibExport(string account)
  {
         rib_pdf rib = new rib_pdf();
         var pdf = new ViewAsPdf()
         {
            ViewName = "RibExport",
            FileName = "Rib.pdf",
            Model = rib,
            PageHeight = 200,
            PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,

        };
         return pdf
    }

I'm populating my rib model from my code for the contents. I can't see any error from my logs files. I do have:

  1. wkhtmltoimage.exe
  2. wkhtmltopdf.exe

from rotativa folder.

CodePudding user response:

It seems is related with the IIS application pool identity permission issue. I suggest you could firstly set it as system to see if it could resolve this issue.

Like below:

enter image description here

If this has solved your issue, then you could run process monitor to see which permission is needed for accessing the temp folder, after checking it, you could modify the default identity provider IIS APPPOOL\DefaultAppPool's permission to solve this issue

  • Related