Why is System.Net.Http.Formatting trying to load Newtonsoft.Json (6.0.0.0) using .NET 4.8 - json.net

I have .NET 4.8 ASP.NET project that throws a "binding" error while at runtime.
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0,
Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference.
I've triple checked NuGet and binding information in the project files.
I turned on Assembly Binding.
LOG: DisplayName = Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
(Fully-specified) LOG: Appbase =
PrivatePath = F:\inetpub...
Calling assembly : System.Net.Http.Formatting, Version=5.2.8.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35.
Why is System.Net.Http.Formatting trying to load Newtonsoft.Json (6.0.0.0) using .NET 4.8

Related

Error 1001. An exception occurred in the OnAfterInstall event handler of a installer.cs class

Currently my Application containing both .net standard and .net framework Application , during the installation of a msi I am getting the below error.
Error 1001. Error 1001. An exception occurred in the OnAfterInstall event handler of Interop.Service.Installer. --> Could not load file or assembly 'System.Diagnostics.EventLog, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
when I am tring to add the System.Diagnostics.EventLog of .net standard library into .net framework app its showing duplication error.
Error CS0433 The type 'EventLogEntryType' exists in both 'System.Diagnostics.EventLog, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' SPI.Service D:\Cluster01_Test\Process\Service\ServiceInstaller.cs

Assembly uses 'System.Runtime' Version=4.2.2.0 which has a higher version than referenced assembly 'System.Runtime' Version=4.1.2.0

I have a .NET Framework 4.7.2 project that reference a .NET Core 3.1 library. The problem is that I get this error:
Error CS1705 Assembly 'X' with identity 'X, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
In NuGet Manager for both projects, I have tried to add System.Runtime 4.3.1. Still I get the same error. How can this be fixed?

MVVMLight installs one version of assembly, but references different version

MVVMLight 4.3.31.28629 in WPF project, VS2013.
The MVVMLight install (via nuget) added Microsoft.Practices.ServiceLocation 1.2.0.0.
Inspecting MvvmLight.Extras.WPF4, I find this:
My application runs in the debugger, but not when launched from the command line. (It throws an exception from the ViewModelLocator ctor, trying to find Microsoft.Practices.ServiceLocation 1.0.0.0.)
Why does it run inside the debugger, and how do I fix it to run outside the debugger?
Thanks --
UPDATE
What the hell? Why are two versions of the same assembly referenced?
at ProdoMetro.ViewModel.ViewModelLocator..ctor()
InnerException: System.IO.FileLoadException
HResult=-2146234304
Message=Could not load file or assembly **Microsoft.Practices.ServiceLocation, Version=1.2.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)
Source=TimerDoro
FileName=Microsoft.Practices.ServiceLocation, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog=""
StackTrace:
at ProdoMetro.ViewModel.ViewModelLocator..cctor()
InnerException: System.IO.FileLoadException
HResult=-2146234304
Message=Could not load file or assembly **Microsoft.Practices.ServiceLocation, 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)
FileName=Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog==== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)

Unable to find reference to assembly in a Visual Studio website

I have a legacy WebSite project (as opposed to a Web Application project). It was using .net 3.5 but I am updating it to 4.0.
Due to the compilation error ...
Compiler Error Message: CS1705: Assembly 'System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.WebPages,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has
a higher version than referenced assembly 'System.Web.WebPages,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
... I added a reference to the newer version of System.Web.WebPages. This added the following line to the web.config file:
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
However, when I try to build the website I get this error:
The type 'System.Web.WebPages.WebPage' exists in both
c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
I cannot seem to find a reference anywhere in the project to the v4.0 1 version of WebPages. I assume this means that some other assembly is probably referring to it but I'm not sure where to go from here.
Any idea how to track down what is referring to the assembly and either remove the reference or update the calling the assembly?

system.web.extension problem

THIS is the error i am getting when i am compiling my project
Parser Error Message: Could not load file or assembly 'System.Web.Abstractions,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified
Source File: C:\Documents and Settings\Administrator\My Documents\data\Web-page adversting
impression 2\web.config Line: 25
Assembly Load Trace: The following information can be helpful to determine why the
assembly 'System.Web.Abstractions, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' could not be loaded.
Double-check the System.Web.Abstractions DLL is set to "Copy Local = true" (right click on the properties for the reference).

Resources