ASP loading assembly(dll) error - c#

I have an ASP application and I am using the functionality of exporting to Word ( from my RadEditor).
Now I have the following dll and I have placed it in the right folder from where the system should reference it and I want my system to reference only this version of dll :-
Telerik.Windows.Documents.Core.dll
Version 2016.3.1021.40
But whenever I am doing exporting to word it is throwing the below error :-
Could not load file or assembly 'Telerik.Windows.Documents.Core, Version=2015.3.930.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Now can anyone please advise why my system is pointing to Version=2015.3.930.45 when I have Version 2016.3.1021.40, and I did not keep any other version of that dll except the Version 2016.... anywhere in my entire project or what can be done in this situation . ThankYou !

You can try any of the following:
The reference in the config file entry is still pointing to old version. Try to remove the dll and clear the entry in config and re-add
Sometimes cleaning the solution and re-building should simply fix this. (you can try cleaning bin and obj folders manually before doing this)
Remove Temporary Files C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Or any other Telerik DLL which has dependency on this is still using the older version. Try to update all the DLLs related to Telerik Or try to use the DLLs of same versions

Related

Could not load file or assembly 'PayPalCoreSDK'

I have 2 webapp projects that work perfectly with this assembly.
I've tried everything, copy the BIN folder, delete, make a rebuild.
Search for things in the GAC, remove and add references again, with NUGET without NUGET, copy from the folder of projects that work.
My error was that on the first try I added the reference through the nuget manager rather than simply copying the DLLs from the projects that work
Now there is something causing version error.
System.IO.FileLoadException: Could not load file or assembly 'PayPalCoreSDK, Version = 1.7.0.0, Culture = neutral, PublicKeyToken = 5b4afc1ccaef40fb' or one of its dependencies. The localized assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How to clear this mess and fix those references?
Everything is the same as the other 2 projects that work, even code, even web.config.
I do not know where else to look for solutions.
PayPalMerchantSDK (2.16.204.0)
Dependencies: PayPalCoreSDK (1.7.1.0) - Newtonsoft.Json (9.0.0.0)
Did you check the .net framework version in same as your other 2 projects?
After many attempts I managed to make the project work.
However, I had to work with older versions of PayPalCoreSDK and Newtonsof.Json.
Now I will try to adjust the versions to see if I can align all the projects.
But the references are confusing and if it gives problem it seems that only NUGET can refresh DLLs properly
Manual settings in the BIN folder do not work much less in web.config.
I encounter this error as well. I was able to fix it by just downgrading the version of the PaypalCoreSDK to the previous one.

How to resolve "The located assembly's manifest definition does not match the assembly reference." error?

I downloaded source code for pdfiumviewer from git hub. I made changes to one of the projects in that solution.Then I added that project to my application and added reference of that project to one my application's project.I had to uncheck the Signing option for the PDfiumViewer project, as some of the dll in that project are unsigned.I am able to build the application successfully.But at run time when I create an object of one of the class of PDfiumviewer project.It gives me the following error:
Could not load file or assembly 'PdfiumViewer, Version=2.11.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
The version number of the assembly is correct.So, why am I getting this error?
The problem was that I had added reference of old unmodifed PdfiumViewer dll to another project.Hence, there was conflict between the two dlls (old and customized) at runtime.I removed the old dll reference and it worked.
Ive also encountered this issue, my scenario was thou that I had to add a reference from another solution into my project removing the reference was not an option - what worked for me was reinstall SQLclient from nuget package managerer on both solution. Hopes it helo someone else
The issue here is that you have a library that references v2.11.0.0 of the Pdfium library. This library could be an assembly that you built earlier, or another assembly that came from Pdfium that references this version of the library. When you built your version of the library you probably didn't use this same version number, and it wouldn't have been strong named correctly. To fix this, you can add an assembly binding redirect in your applications configuration file to redirect the offending library to your custom built one.
I wrote a program to fix this issue automatically: https://github.com/BackTrak/DependencyFixup/releases/tag/1.0.0.0
I know this question is old, but hopefully this helps out others!

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect

My system was shut down unfortunately after restart my system when I am trying to open project in Visual studio 2013, Project build successfully but when open project in browser, I got below error, I tried clear temp memory but I am not able to solved.
Can some one help me please.
Error Message :
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Found the same question Here.
Looks like a corrupted assembly being referenced.
Clear both:
the \bin folder of your project
the temp folder (should be C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files in windows 7)
and see if the error still happens
can you please clear the solutions and then deleted the Ajax control toolkit reference form project then add it again as new one.
or else remove all temporary files from following path
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

Assembly's definition does not match

Error 2 Could not load file or assembly
'CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Can anyone tell how to correct this error?
I tried to delete the files from the bin folder and I even tried downloading a new dll file and added reference to it. Still it didnt work out.
The solution was pretty simple. Just delete the assembly and associated files from my projects bin folder and then choose Add Reference to add the latest version back in.
This can be due to your project file referring to one version while the version copied into the bin folder is a different one. So when the app runs it's trying to load the version the project file references, but finds only the one copied into the bin folder.
Was the library added through Nuget? It could be that the version in the referenced in packages.config and used in the build doesn't match the version number in the project file.

Watin Exception [duplicate]

I am getting the following WatiN error:
Unhandled Exception: System.IO.FileLoadException: Could not load file
or assembl y 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=db7cfd3acb5 ad44e' or one of its dependencies. The
located assembly's manifest definition do es not match the assembly
reference. (Exception from HRESULT: 0x80131040) File name:
'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db
I copied the shDocvw.dll from System32 to the bin directory but still it is giving me the same problems.
If you've installed and referenced WatiN using NuGet in VS2010, you should already have the correct references, so they don't need to be removed and re-added. But you will still need to change the "Embed Interop Types" setting to False on the Interop.SHDocVw reference.
UPDATE: This answer was written before Nuget was released and applies only if you are NOT using Nuget to manage your dependencies. If you are using Nuget see the answer by #Nick Jones
I just had this issue today. You need to download the latest version of WatiN (I'm using 2.0.10.928) and reference the signed Interop.SHDocVw.dll that is provided by WatiN.
Try the follwoing:
Remove all other References to Interop.SHDocVw.dll
Right Click your solution and select 'Clean Solution'
Reference the Interop.SHDocVw.dll that is provided by WatiN
Build your solution.
Hope this helps.
UPDATE: Nick Jones is correct. This should not be an issue if you are using NuGet....but I was also getting this message when using MvcContrib.Mvc3.TestHelper-ci. At first glance it seems like the '-ci' packages is the way to go but I decided to use the MvcContrib.WatiN package for two reasons.
1) I don't get the "Could not load file or assembly" error message
2) The MvcContrib.Mvc3.TestHelper-ci is using an old version of WatiN.Core.dll (1.3.0.4000) where as the MvcContrib.WatiN package is using a newer version (2.0.0.99)
Check out the Properties of the Reference "Interop.SHDocVw.dll". Change the "Embed Interop Types" to False.
The problem is that it is not copying the dll file in your bin folder. But after this setting, it will do it properly.
I had the same error, and now its working fine.

Categories

Resources