We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Could not load file or assembly error

I recently upgraded from 6.9, to 10.5. However, I can’t seem to keep from getting this error (below). I did all the usual resolutions for this type of error. I cleaned the solution and rebuilt. I cleared out the ASP.NET Temporary Files. I went through every project and deleted all references of the Aspose DLL and then used Nuget to install the Aspose.PDF (which brings it up to 10.5.1).


Could not load file or assembly ‘Aspose.Pdf, Version=10.5.1.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Hi there,


Thanks for your inquiry. It seems the issue is related to Nuget, as you are unable to upgrade dll version referenced via Nuget. Please check following link, hopefully it will resolve the issue.

http://stackoverflow.com/questions/24040612/vs2010-update-nuget-package-to-a-specific-version-but-also-update-dll-reference

Please feel free to contact us for any further assistance.

Best Regards,

Are you saying not to update using NuGet? Or are you saying that I should update using Nuget using the explicit version number like below?


Update-Package Aspose.PDF -version 10.5.1

And actually, if you can recommend a way that I can just clear out all of the Aspose.Pdf references and add it to the project in a way you can guarantee I don’t run into this issue, that would be more ideal.

I just updated all projects in the solution that use the Aspose.PDF in NUGET (apparently the latest version is 10.6) and it uninstalled 10.5.1 from all of them and then successfully updated to 10.6 and now I get this error:


Could not load file or assembly ‘Aspose.Pdf, Version=10.6.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly ‘Aspose.Pdf, Version=10.6.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

Line 21:             var pdfLicense = new Aspose.Pdf.License();
Line 22: pdfLicense.SetLicense(“Aspose.Pdf.lic”);
Line 23: }
Line 24: public Pdf(string licensePath)
Line 25: {

Source File: c:\Users\rich_001\Documents\TFS\Main\Mb3Aspose\Pdf.cs Line: 23

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘Aspose.Pdf, Version=10.6.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ could not be loaded.

What’s weird is that in another assembly (which is VB.NET) it works fine in my VB.NET website. But when I try to use it from this assembly (which is CS) that’s the one I get the error on. Is there something around the fact that it’s a CS assembly being used in a VB.NET website?

Well, I converted the entire assembly to VB to see if that made a difference but it didn’t. I made a brand new project, added the Aspose.Pdf 10.6 via Nuget and I get the same exact error.

So, I unistalled and removed every reference of Aspose from every project in my solution so there was no trace of it anywhere. I closed VS and reinstalled Aspose using the MSI installer. I started VS back up and added the reference to 10.5 (which is the version I installed) and I get this:


Could not load file or assembly ‘Aspose.Pdf, Version=10.5.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly ‘Aspose.Pdf, Version=10.5.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

Line 21:             var pdfLicense = new Aspose.Pdf.License();
Line 22: pdfLicense.SetLicense(“Aspose.Pdf.lic”);
Line 23: }
Line 24: public Pdf(string licensePath)
Line 25: {

Source File: c:\Users\rich_001\Documents\TFS\Main\Mb3Aspose\Pdf.cs Line: 23

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘Aspose.Pdf, Version=10.5.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileLoadException: Could not load file or assembly ‘Aspose.Pdf, Version=10.5.0.0, Culture=neutral, PublicKeyToken=6947866647e416ec’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
Mb.v3.MbAspose.Pdf…ctor() in c:\Users\rich_001\Documents\TFS\Main\Mb3Aspose\Pdf.cs:23
MbWeb.FormFill2.Page_Load(Object sender, EventArgs e) in C:\Users\rich_001\Documents\TFS\Main\MbWeb2\Requests\FormFill.aspx.vb:11
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

I finally figured it out. I had a folder called “Dependencies” in my web project which is where the 6.9 version was referenced from initially so every time that I tried to reference the new version of a different location it would always just reference the old version from the original location. Seems like a bug in VisualStudio to me but who knows. Anyway, I deleted that version from the folder and it is referencing properly now.

Hi there,


We are truly sorry the inconvenience caused. However it is good to know that you have manged to figure out the issue. Ideally update option from “Manage NuGet Packages” should work other wise need to remove manually the references.

Please keep using our API and feel free to contact us for any query or concern, we will be more than happy to extend our support.

Best Regards,