How to fix Newtonsoft.Json assembly loading error? - visual-studio-2012

I'm attempting to load a pre-existing Umbraco CMS site into a Visual Studio project and am caught up in a bit of DLL hell.
Here is the error message I get when attempting to compile the site:
Could not load types from assembly Umbraco.Core, Version=1.0.5462.37503, Culture=neutral, PublicKeyToken=null, errors:
Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
File name: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
I've attempted to re-install Newtonsoft from NuGet, re-install Umbraco from NuGet, delete all DLLs and re-install, removed the Newtonsoft dependentAssembly, every possible solution I've been able to find and this error continues to come up.
Any suggestions?

I'm guessing the binding redirect isn't set up correctly in the web.config file. Try running this in the nuget package manager console:
PM> Get-Project –All | Add-BindingRedirect

This ended up being a bit of a misunderstanding on my part from following the Umbraco videos. I was attempting to set up a new Visual Studio project, import all the DLLs needed, and then move the site content into the project.
All I really needed to do was create a blank project, then move the site content, with all of its DLLs, into the project. This let me immediately start editing the project.

The best solution was to install an earlier version of the package and then upgrade.

Related

Azure Notification Hub Client run time error

Downloaded latest Microsoft.Azure.NotificationHubs NuGet package used the NotificationHubClient to create an installation this.HubClient.CreateOrUpdateInstallation(installation);
All the default dependent packages were used when adding the NuGet. When testing I am receiving the following error:
Could not load file or assembly 'Microsoft.Extensions.Options, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I assume this is widely used. How do I get past this?
This is version conflict issue. Remove all your old version package and reinstall Microsoft.Extensions.Options, it will work 👍

Trying to Use System.Diagnostics.Process v4.3 Encounters a v4.1 Not Found Error

I have the "System.Diagnostics.Process" v4.3 NuGet installed but when trying to use one of its functions I encounter a "can't find v4.1" error.
I needed the Nuget. I initially installed v4.1 because I am working on software supporting older OS's, but it was not compatible so I install v4.3 which was compatible with my solution.
I have searched for code/files referencing the library, but none seem to specify it other than the csproject which references the v4.3 version. I have reinstalled the NuGet. I have clean the solution and deleted the bin/obj directories. I have clean the NuGet caches and force a reload. The v4.3 DLL is present in a number of paths/folders, but not v4.1 DLL.
Is there somewhere else that I should look for the specification/path of the lib being used?
Error:
{System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.Process, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Diagnostics.Process, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Sentry.CognitiveServices.GetPathWithGetMappedFileName(SafeMemoryMappedViewHandle memoryMappedViewHandle)
at Sentry.CognitiveServices.<SpeakNarrative>d__13.MoveNext()}
Expect V4.3 to be referenced, not v4.1.

CS0012 The type 'XtraReport' is defined in an assembly that is not referenced

I recently updated my visual studio to 2017 Enterprise.
I used to use DevExpress v15.1
Today, I upgraded my DevExpress to version 18.1 and when I build my .Net MVC5 Application Solution, I got the following error
The type 'XtraReport' is defined in an assembly that is not
referenced. You must add a reference to assembly
'DevExpress.XtraReports.v15.1, Version=15.1.8.0, Culture=neutral,
PublicKeyToken=b88d1754d700e49a'.
The above Error is located in ReportController.cs
I checked my references Folder under the project to find that the DevExpress.XtraReports.v18.1 is there.
What might be the cause of this error?.
Thank you for your help.
Based from the message, the XtraReport still references the older version of its DLL assembly:
'DevExpress.XtraReports.v15.1, Version=15.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a'
Usually this problem occurred because Project Converter failed to update XtraReport related references after upgrade. In this case, you can manually remove all references to older assemblies (version 15.1) and then add references to new assemblies (version 18.1).
Also make sure that web.config file has these assembly information like below example (X indicates revision number):
<add assembly="DevExpress.XtraReports.v18.1, Version=18.1.X.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<add assembly="DevExpress.XtraReports.v18.1.Web, Version=18.1.X.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
If the solution above failed, try install the assemblies to the Global Assembly Cache (GAC) by navigating to X:\Windows\assembly (X stands for the system drive letter) and copy all new DevExpress assemblies to that folder (including DevExpress.XtraReports.v18.1), as mentioned in this issue.
Related issues:
Errors after upgrading DevExpress version
DevExpress.XtraReports.UI.XtraReport is not defined after upgrade
The type 'DevExpress.XtraReports.UI.XtraReport' is defined in an assembly that is not referenced

Microsoft.SharePoint.Client.Runtime.Portable is missing

I upgraded my site from Kentico 10.0 to 11.0. When I load site then I am getting the following error
Reference.svcmap: Could not load file or assembly
'Microsoft.SharePoint.Client.Runtime.Portable, Version=16.1.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its
dependencies. The system cannot find the file specified.
I installed an SDK package and also tried Install-Package Microsoft.SharePointOnline.CSOM -Version 16.1.7414.1200 but not getting 'Microsoft.SharePoint.Client.Runtime.Portable' dll.
Could you please suggest a solution for me?
Open the NuGet package manager in VS and make sure all projects reference the same version of the Microsoft.SharePointOnline.CSOM package, which should be 16.1.6621.1200 according to the documentation.

Could not load file or assembly 'log4net'

My crystal report page gives an error "Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference."
Do I have to have ddl for 1.2.10 or 1.2.11 in bin folder? Or what can be wrong?
If you have a x86 development machine and your web server is a 64-bit machine, you may be running into the problem discussed in this thread.
Visual Studio is automatically deploying a 32-bit log4net.dll into the 64-bit web server, even if you don't have it referenced in your project. Just delete the log4net.dll from your bin directory once deployment has finished because it's not actually required by the CR runtime to work.

Resources