Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 838
Lucas Perrett Avatar asked Mar 05 '18 01:03

Lucas Perrett


People also ask

Could not load file or assembly Newtonsoft JSON in SQL?

Instead of adding a reference, try a modern approach: right-click the project in Solution Explorer, then “Manage NuGet Packages…”, then select the Browse tab, find and select the product, and click Install. And if that doesn't resolve it, remove it manually from the GAC, then do it again.

Could not load file or assembly Newtonsoft JSON in SSMS?

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. Rebuild solution.

What is Newtonsoft JSON?

The Newtonsoft. JSON namespace provides classes that are used to implement the core services of the framework. It provides methods for converting between . NET types and JSON types.


1 Answers

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.

like image 76
live-love Avatar answered Nov 08 '22 19:11

live-love