Rotativa PDF generation working locally but not on IIS 7

后端 未结 7 1063
难免孤独
难免孤独 2020-12-29 04:02

I have an ASP.NET MVC 5 application. It has a simple form and when the user submits it, the form is stored in the cache and then another controller action is called, this ac

相关标签:
7条回答
  • 2020-12-29 04:13

    This error is a missing C++ redistributable Package for Visual Studio 2013 file called (MSVCP120.dll).

    To solve the issue:

    1. Open the C++ redistributable Package for Visual Studio 2013 downloadable link below: download Visual C++ Redistributable Packages for Visual Studio 2013

    2. Click Download and choose the file (vcredist_x86.exe) even if you are running X64 bit server version.

    3. Install the file.

    Check Jalal W Hijazi Blog http://jwhijazi.blogspot.com/2015/05/solving-rotativa-unhandled-exception.html for more details.

    0 讨论(0)
  • 2020-12-29 04:13

    When I upgraded from Rotativa 1.6.4 to 1.7.3 my PDF conversion on my website app stopped working and after running the wkhtmltopdf.exe on my production server I noticed it was having an issue with msvcp140.dll

    Solution was to install Visual C++ Redistributable for Visual Studio 2015 https://www.microsoft.com/en-us/download/details.aspx?id=48145

    0 讨论(0)
  • 2020-12-29 04:13

    I installed Visual C ++ Redistributable Packages for Visual Studio 2015

    https://www.microsoft.com/pt-br/download/details.aspx?id=48145

    This solved for me.

    0 讨论(0)
  • 2020-12-29 04:18

    As mentioned in the comments on the blog linked in the answer, you can just copy the 2 following dll files to the rotativa folder on the server if you don't want to / can't easily install things on the server.

    msvcr120.dll
    msvcp120.dll

    If it's working locally, you should have the two dll files available already. You need the x86 versions, if you find x64 versions packaged with vs 2015 they don't work. I found the right versions here:

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x86\Microsoft.VC120.CRT
    

    After upgrading to Rotativa 1.7.3 this no longer worked. I had to copy over some new dlls from visual studio 2017, i found them here this time:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT
    

    and i had to copy over

    msvcp140.dll
    vcruntime140.dll

    0 讨论(0)
  • 2020-12-29 04:27

    The accepted answer almost worked for me. I was missing a newer version of the C++ redistributable so installing the old version didn't help.

    The easiest way to find out what you are missing is to run wkhtmltopdf.exe manually. It will either give you console output (if working) or a message box about what's missing.

    I was missing MSVCP140.dll, which is from the VS 2015 redist, available here: https://www.microsoft.com/en-gb/download/details.aspx?id=48145

    0 讨论(0)
  • 2020-12-29 04:33

    I fixed my issue by updating the wkhtmltopdf files from the installer found here

    enter image description here

    Working flawlessly now!

    0 讨论(0)
提交回复
热议问题