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
This error is a missing C++ redistributable Package for Visual Studio 2013 file called (MSVCP120.dll).
To solve the issue:
Open the C++ redistributable Package for Visual Studio 2013 downloadable link below: download Visual C++ Redistributable Packages for Visual Studio 2013
Click Download and choose the file (vcredist_x86.exe) even if you are running X64 bit server version.
Install the file.
Check Jalal W Hijazi Blog http://jwhijazi.blogspot.com/2015/05/solving-rotativa-unhandled-exception.html for more details.
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
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.
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
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
I fixed my issue by updating the wkhtmltopdf files from the installer found here
Working flawlessly now!