Json.Net 9.0.1 not working in WP8.1 Device - json.net

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.

Related

Core Application (Targeting .NET Framework) - IIS Publish Error "Could not load file or assembly System.Runtime"

I'm trying to port over an application I wrote in .NET Core to .NET Core (Targeting .NET Framework), due to the inability to impersonate in Core [from my previous SO].
I created the application and ported over all my Views, Controller, and Models, and implemented the WebClient like I needed to. It runs perfectly fine on my IIS Express locally, but when I publish to IIS I get the error:
FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.1.0.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)
There are several StackOverflow threads and solutions, but they're all designed for .NET Core 1.0.1 with the project.json setup, and they don't translate well to csproj. Has anyone encountered this error before?
Full stack trace:
System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.1.0.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)
File name: 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at TIM.MVC.NET.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
I have tried setting my Application Pool to both No Managed Code and CLR 4.0, neither has any impact on the error that appears. I also tried running
Install-Packem System.Runtime
and that didn't do anything. I can see the System.Runtime.dll file in the ref folder on the server where IIS is hosted, and like I said it works when I run the application in debug with no issues. Thoughts?

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

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

ASP .NET Web Forms: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0

I moved my existing ASP .NET web sites and web applications to a new server, and I'm getting the following error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
I located this assembly on my computer, and copied it to the BIN folder of my web site. It gives a new error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040)
Does this mean ASP .NET is not properly installed on the server machine? How do I go about fixing this? I also noticed that the assembly is present on my computer somewhere in the Program Files (x86)/Microsoft ASP.NET folder. However, the Program Files (x86)/Microsoft ASP.NET folder does not exist on the server.
Solution: I installed both ASP .NET Web Pages and ASP.NET MVC 4 on the server. This installed the missing assemblies and created the folders that were missing.
The exceptions speak for themselves: Your project has referenced version 2.0.0.0 of this assembly and you have copied version 1.0.0.0
Find the correct version and you'll be OK

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

Trouble loading assembly: 'Microsoft.Practices.EnterpriseLibrary.Common'

I have a VS 2008 solution whose projects are making use of a number of the Microsoft.Practicies libraries.
**Versions for all of the assemblies are: 4.1.x
Everything builds fine, but when I run it, I get the following runtime error:
Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
There are no versions of the enterprise library installed on the machine where the building and running is taking place.
"Copy Local" is true, and "Specific Version" is false for all assemblies.
What am I doing wrong here?
Related: Could not load file or assembly, Force Visual Studio References
The Microsoft practices libraries are tightly coupled, and some of the assemblies are interdependant. Make sure that you have added all the libraries you need, plus any additional library dependencies

Resources