In my program, actively use tuespechkin. I have 2 convert method which uses TuesPechkin.dll. One of them includes only body data without footer and header.

But other one, has header and footer that uses HtmlUrl property of object settings. First method never throw exception in IIS but second method which uses 3 url (1-> body, 2-> header, 3-> footer) throw exception in IIS like that.

Faulting application name: iisexpress.exe, version: 10.0.17763.1, time stamp: 0xc5191a01 Faulting module name: wkhtmltox.dll_unloaded, version:, time stamp: 0x54bd024e Exception code: 0xc00001a5 Fault offset: 0x00fe4ab1 Faulting process id: 0x5470 Faulting application start time: 0x01d4fb68100115f7 Faulting application path: C:\Program Files (x86)\IIS Express\iisexpress.exe Faulting module path: wkhtmltox.dll Report Id: 87e9a0cf-b084-480a-a673-da1bd5d87976 Faulting package full name: Faulting package-relative application ID:

My method

var document = new HtmlToPdfDocument
            GlobalSettings = {
                ProduceOutline = true,
                DocumentTitle = title,
                Orientation = orientation,
                PaperSize = PaperKind.A4,
                Margins =
                    Left = 1.375,
                    Right = 1.375,
                    Top = top,
                    Bottom = bottom,
                    Unit = TuesPechkin.Unit.Centimeters

            Objects = {
                new ObjectSettings {
                    PageUrl = link,
                    HeaderSettings = new HeaderSettings{HtmlUrl = headerPath, ContentSpacing = 2 },
                    FooterSettings = new FooterSettings{HtmlUrl = footerPath,}
        var tempFolderDeployment = new TempFolderDeployment();
        var win32EmbeddedDeployment = new Win32EmbeddedDeployment(tempFolderDeployment);
        var remotingToolset = new RemotingToolset<PdfToolset>(win32EmbeddedDeployment);

        var converter = new ThreadSafeConverter(remotingToolset);

        byte[] result = converter.Convert(document);

Notes: 1)I dont get this error every time. 2)my html url is not local url. 3)if i wait thread 1000 ms before remotingToolset.Unload(), frequency of the error decreases. 4)I tried to install c++ redistributable but not solve. 5)I tried to install latest version of tuesPeckhin from nuget but also that is not solve my problem.

My OS is x64.

0 Answers