"Could not load file or assembly" error when installing Google.api.customsearch.v1 client library - asp.net

I am trying to install Google.api.customsearch.v1 client library from Nuget but I get this error when I try to run my asp.net website.
Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0,
Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
I have discovered stackoverflow for such issue, but non of them resolved my problem. any suggestion?

Ok, I fixed the problem by updating Newtonsoft.Json package. Run the following command in the Package Manager Console
Update-Package Newtonsoft.Json

Related

Json.Net 9.0.1 not working in WP8.1 Device

I'm getting the following exception when the json.net dll 9.0.1 is going to be loaded in my Windows Phone 10 (App compiled in ARM architecture), in the emulator it loads fine.
"Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
I tried adding the dll manually but it has the same problem.
I ended up downgrading to version 8.0.3 which works perfectly.

Can not load assembly for 'Microsoft.Owin'

I have an issue in asp.net web API where when I add Signlr class I get. I can see in the references Microsoft.Owin
Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. >The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'Microsoft.Owin' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
I suggest to check what you have in packages.config, web.config and packages folder. They all should link to the same package version. Quite often if you update version of some package via NuGet, there may raise compability issues.
P.S. If it not help you may delete and istall OWIN again via NuGet.
It seemed like you confused with SignalR project development. Please read this article.
Try removing the dependency from project.json and build the solution and then add it back.
Worked for me

ASP.NET - How to remove Newtonsoft.Json dependency

I added the reference file "Newtonsoft.Json.dll" to my project. After a while, I decided to remove the reference from References section of project. Projects started to give following error :
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
I tried everything. I searched any words with "Newtonsoft" in the project and delete all of them. But nothing changes. I am getting still this error. Can anyone help me? How can I remove this reference forever ?
I found the solution. The project requires "Newtonsoft.Json, Version=4.5.0.0", But I realized that I load the "Newtonsoft.Json, Version=6.0.0.0" version. After I add v6 dll file to project, the problem solved. Thanks for your responses.

"The located assembly's manifest definition does not match the assembly reference" error after installing AjaxControlToolkit via NuGet

The full error:
Parser Error Message: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.7.1005, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This doesn't make sense because the package version I installed was 4.1.7.1213. When I look at the build server logs Nowhere do I see any other version than that.

Could not load file or assembly 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I am developing Web Application to upload a file on Google Drive but, there is a runtime exception as :- Could not load file or assembly 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I don't have any idea about this Please help me...
Try following approach:
Open Visual Studio
Go to Tools -> Library Package Manager -> Package Manager console
Run the following command:
PM>Install-Package Microsoft.Bcl.Async

Resources