Could not load file or assembly 'Newtonsoft.Json' Version=11.0.0.0

could not load file or assembly dll
could not load file or assembly version=1.0.0.0 culture=neutral publickeytoken=null
could not load file or assembly or one of its dependencies an attempt was made
could not load file or assembly iis
could not load file or assembly visual studio 2017
could not load file or assembly 'unity abstractions
could not load file or assembly net core
could not load file or assembly powershell

I have read a lot of the responses to previous versions of this issue but none seem to work.

Every time I open my script component in Visual Studio 2015 (v14.0.25431.01 update 3) it tells me I am missing a reference to Newtonsoft.Json. So I go into NuGet Package manager and it asks me to Restore which I do and says it completes successfully.

I then save and try and run my SSIS package and get the following error.

Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependancies. The system cannot find the file specified.

my packages.config file looks like this.

    <?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Newtonsoft.Json" version="11.0.1" targetFramework="net45" />
</packages>

and my app.config file looks like this.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json"
                publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
      <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

I can navigate to the folder that it is looking for and see the .dll file

C:\Users\lp1.db\AppData\Local\Temp\Vsta\SSIS_SC130\VstaGbmf__V5kCUWonnRT2qrG_g\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll

Has anyone else had this continual issue with it losing the ability to find the file despite being set.

Remove all the references to Newtonsoft.Json in all your projects.

Go to Nuget Package Manager (right click on solution), download Newtonsoft.Json latest version and select all the projects to use it, and reinstall it.

Make sure the packages.config have the latest version:

<packages>
  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
</packages>

Rebuild solution.

Could not load file or assembly or one of its dependencies, Check if you are referencing an assembly which in turn referencing an old version of unity. For example let's say you have an assembly called  Could not load file or assembly ‘[assemblyname]’ or one of its dependencies. An attempt was made to load a program with an incorrect format. No fear, though, as this is usually easily fixed. In quite a few cases, it’s simply a mismatch between architectures and easily changed. Reason

This is one of the most common problems in .NET projects. Basically someone made a reference directly to an local assembly instead of managing the package via NuGet or the project was made to compile in a different .NET version. The best way to solve this is to locate the reference in your project references, remove it, clean the project, check if the DLL has gone and finally remake the reference using NuGet.

Error : Could not load file or assembly or one of it's dependencies , Yeah!!! I found a solution for this terrible error First of all Thanks for every one who tried to help me Here's my solution Right Click on the  But today when I try to Debug, this error came. Error while trying to run project: Could not load file or assembly 'Power' or one of its dependencies. The module was expected to contain an assembly manifest.

Try to copy NewtonSoft.Json to the SQL SSIS Runtime folder

C:\Program Files (x86)\Microsoft SQL Server\[SQL Server version]\DTS\Binn

example (SQL Server 2016)

C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn

[Solved] Could not load file or assembly (dll file), So it works if I change in the c# project from Any CPU to x86(all dlls are compiled in WIN32) from Properties -> Build -> Platform Target. In most cases .NET manages to solve the DLL hell problem pretty well, but sometimes it all falls apart, and when it does in best case scenario we see something like this: Could not load file or assembly 'XXXX, Version=X.Y.Z.W, Culture=neutral, PublicKeyToken=eb42632606e9261f' or one of its dependencies.

Try clean your project.

Clean Project in Visual Studio

If this don't work, remove the reference under references. Save the dll file in your bin folder and then add it again. Browse your file, select it and click in ok.

Could not load file or assembly 'xxx' or one of its dependencies error , The system could not find the 'Episerver.Forms.Core' assembly file to load. There are some workarounds for this issue: The dll file may not be in  Additional information: Could not load file or assembly 'Microsoft.Practices.Unity, 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.

I had a similar issue when I had two different projects within the same solution, in which one of them is referring to version 11.0.2 and the other is referring to version 6.0.4. If this is the case, try keeping the same version for both of them and retry.

Could not load file or assembly, Could not load file or assembly. Back in the days .NET tried to solve the so called DLL Hell with its GAC and versioning. It more failed than succeeded in doing  The system cannot find the file specified. ----> System.IO.FileNotFoundException : Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Auto binding redirects is a feature of .net 4.5.1. Whenever nuget detects that the project is transitively referencing different versions of the same assembly it will automatically generate the config file in the output

Could not Load File or Assembly or one of its , The located assembly's manifest definition does not match the assembly reference. _. The bin folder of the Web application did have a Newtonsoft  Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///C:\_PRO DUKCIJA\Debug\DynamicHtmlTool.exe' or one of its dependencies. An attempt was ma de to load a program with an incorrect format..

Fixing the "Could not load file or assembly or one of its , This post describes how to fix the “Could not load file or assembly '[​assemblyname]' or one of its dependencies. An attempt was made to load a  FileLoadException: Could not load file or assembly 'PU, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. Once this issue happens, if we restart the application pool the system works fine. This is happening only production server not in our QA/UAT/DEV servers.

"Could not load file or assembly" error when you compile a SDK , Could not load file or assembly 'file:///C:/Windows/assembly/GAC_32/Interop.SAF​/8.0.0.0__31bf3856ad364e35/Interop.SAF.dll' or one of its  Now im getting 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. (Exception from HRESULT: 0x80131040) – EK_AllDay Aug 5 '18 at 22:45

Comments
  • @Hadi I'm not sure removing the visual studio tag as you did is correct here. Are you sure this is not related to visual studio (or possibly nuget)?
  • I think the problem is if your project is NET 4.6.2 you should use version 9.0.1 max. If you want to use the later ones you should upgrade your project to NET 4.7.2 - I think it is something to do with NET STANDARD 1.6 to 2.0 transitions.
  • Try to copy the dll file to an external folder. Delete the reference and add it again from this folder