We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HTML to PDF - Error When Deploying on Server "Could not load file or assembly Syncfusion.Compression.Base"

Thread ID:

Created:

Updated:

Platform:

Replies:

149993 Dec 17,2019 09:03 AM UTC Dec 20,2019 03:26 PM UTC ASP.NET MVC - EJ 2 7
loading
Tags: PDF
johnny
Asked On December 17, 2019 09:03 AM UTC

Hi. I created an application which uses Syncfusion's HTML to PDF conversion libraries. Everything works as expected on my dev machine.
But when I published the project, I am getting assembly error.

I even referred to the article here: https://www.syncfusion.com/kb/8841/how-to-publish-html-to-pdf-converter-to-server
But no luck.
I do see that there are no assmbly entries in he web.config file.
Here's the error I am getting:

Could not load file or assembly 'Syncfusion.Compression.Base, Version=17.3450.0.14, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)",
    "Exception": "System.IO.FileLoadException: Could not load file or assembly 'Syncfusion.Compression.Base, Version=17.3450.0.14, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'Syncfusion.Compression.Base, Version=17.3450.0.14, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'\r\n   at 
Syncfusion.Pdf.Compression.PdfZlibCompressor.Compress(Stream inputStream)\r\n   at Syncfusion.Pdf.Compression.PdfZlibCompressor.Compress(Byte[] data)\r\n   at Syncfusion.Pdf.Primitives.PdfStream.CompressContent(IPdfWriter writer)\r\n   at Syncfusion.Pdf.Primitives.PdfStream.Save(IPdfWriter writer)\r\n   at Syncfusion.Pdf.IO.PdfArchiveStream.Save(IPdfWriter writer)\r\n   at Syncfusion.Pdf.IO.PdfCrossTable.DoSaveObject(IPdfPrimitive obj, PdfReference reference, PdfWriter writer)\r\n   at Syncfusion.Pdf.IO.PdfCrossTable.SaveArchives(PdfWriter writer)\r\n   at Syncfusion.Pdf.IO.PdfCrossTable.Save(PdfWriter writer)\r\n   at Syncfusion.Pdf.PdfDocument.Save(Stream stream)\r\n   at RuleEngine.RunActionResponse(Nullable`1 clientId, Nullable`1 loanId, CustomRuleQuery customQuery,) in D:\\CNG\\RuleEngine.cs:line 2415\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n"

Gowthamraj Kumar [Syncfusion]
Replied On December 18, 2019 09:50 AM UTC

Hi Johnny, 

Thank you for using Syncfusion products. 

We suspect that the reported exception might be due to mismatched product version of Syncfusion assemblies. So, we request you to refer the same product version of Syncfusion assemblies to resolve this issue. Kindly refer the below KB link, 
 
If you have already installed the Syncfusion assemblies in your server machine, kindly remove those assemblies in your machine and GAC location, then install the required version assemblies to avoid version conflicts. Please refer the below links for removing the assemblies from GAC, 

Can you please let us know which NuGet package, you are using for converting HTML to PDF, Kindly refer below KB link for converting HTML to PDF from NuGet package.  

If still you are facing the same exception, we can have the web meeting to directly look into the issue on your server and provide the solution at the earliest. Please let us know your availability for web meeting, we will make every effort to have this scheduled on a time of your convenience. 

Regards, 
Gowthamraj K 


johnny
Replied On December 18, 2019 01:31 PM UTC

Hi Gowthamraj,

Thank you for the detailed response.
From the first two links, I assume that I need to have the Syncfusion Essential Studio installed on the prod server. Is that correct?
I had just installed it on my local machine and I hoped that required DLLs in the bin folder will be enough for the processing on prod server.
I am using the Blink engine for converting HTML to PDF and I have correctly added the folder to the published project folder.

I did not download HTML to PDF from Nuget. I installed HTML Converter as shown in docs here.

If I need to install the complete package (Studio and Converter) on server, that would be weird. Otherwise we can connect via web meeting.

Prakash Viswanathan [Syncfusion]
Replied On December 19, 2019 07:32 AM UTC

Hi Johnny, 

There is no need to install Essential studio or HTML converter in server, you can install and get the required assemblies/files from the local machine. Kindly ensure all the Syncfusion assemblies are in same version on your server. Please refer below screenshot, 

 

If still you are facing the same issue, then we can have the web meeting to directly look into the issue on your server and provide the solution at the earliest. Please let us know your availability for web meeting, we will make every effort to have this scheduled on a time of your convenience. 

Regards, 
Prakash V 


johnny
Replied On December 19, 2019 08:47 AM UTC

Hi.
The versions seem to be in order for all 3 DLLs.
I am available between 6am and 1pm GMT. Please let me know how we can connect. I can connect today too.


Prakash Viswanathan [Syncfusion]
Replied On December 19, 2019 10:43 AM UTC

Hi Johnny, 

Thank you for the update.  

It seems, you are using Syncfusion.Compression.Base.dll with 17.3460.0.14 and other libraries with 17.3450.0.14. Can you please try the conversion with exact same version of the assemblies and let us know the result.   

Regards, 
Prakash V 


johnny
Replied On December 19, 2019 11:20 AM UTC

Hi Prakash,
Thank you for pointing that out to me. I don't know what tricks my mind is playing on me, but I did not even register the version change.
Deploying the correct DLL version worked. :)

An issue though: After I changed the reference in Visual Studio, the version was showing as 17.3450.0.14, but when I published, the DLL version was still 3560.
I had to manually change the DLL form Syncfusion installation path to get it to work.

Prakash Viswanathan [Syncfusion]
Replied On December 20, 2019 05:13 AM UTC

Hi Johnny, 

Thank you for the update.  

Regarding the version issue on deployment, kindly try clean/rebuild the solution and try publishing with new publish folder. If still the same issue occurs, the assembly may refer the from the GAC location based on the application target framework. Kindly uninstall the all the Syncfusion assemblies from GAC location on your local machine and refer the assemblies from particular folder, then deploy it to the server.  

Please let us know if you need any further assistance on this.  

Regards, 
Prakash V 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon