Hi,
I'm using the Rotativa 1.6.4 Nuget package in our .net MVC(5.2.3) web application.
I have copied following files in the Rotativa folder of my Visual Studio project. The same files are copied across to the project release folder on our new web server hosting the web application.
wkhtmltopdf.exe (0.12.2.1)
msvcp120.dll (12.0.21005.1)
msvcr120.dll (12.0.21005.1)
vccorlib120.dll (12.0.21005.1)
The PDF creation works as expected in our development environment.
But on our new web server PDF creation is not working. The following error is thrown on calling Rotativa.ActionAsPdf.BuildPdf.
11/11/2023 3:44:13 PM: Exception:System.Exception: Error: Failed loading page https://<WebsiteDomainName>/GeneratePDF?staffToken=<token> (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: UnknownNetworkError
at Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches, String html)
at Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches)
at Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context)
at Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context)
11/11/2023 3:44:13 PM: Exception:System.Exception: BUILD_PDF - System.Exception: Error: Failed loading page https://<WebsiteDomainName>/GeneratePDF?staffToken=<token> (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: UnknownNetworkError
at Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches, String html)
at Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches)
at Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context)
at Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context)
Oure new server configuration:
Windows Server 2022 Standard(64 bit)
Microsoft Visual C++ 2015-2019 Redistributable(x64) - 14.29.30133
Microsoft Visual C++ 2015-2019 Redistributable(x86) - 14.29.30133
PDF generation was working on our old server which is with following configuration:
Windows server 2012 R2 standard (64 bit)
Microsoft Visual C++ 2015-2019 Redistributable(x64) - 14.27.29112
Microsoft Visual C++ 2015-2019 Redistributable(x86) - 14.27.29112
Microsoft Visual C++ 2012 Redistributable(x64) - 11.0.61030
Microsoft Visual C++ 2008 Redistributable(x64) - 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable(x86) - 9.0.30729.6161
HTTPS redirection is enabled in the application Web.config on both our old and new servers.
Appreciate if you could let me know how to get the PDF creation working on our new server. Is it enough that 'Microsoft Visual C++ 2015-2019 Redistributable' is installed on our new server or, do we need to install one of the older versions of 'Microsoft Visual C++ Redistributable' on our new server to get the PDF creation installed? Or are we missing something else?
Your help on this is most appreciated.
Many Thanks