Cannot Add JSON.NET DLL

Siavash Mortazavi asked on February 16, 2016 22:04

Hi,

I'm trying to add the JSON.NET 3rd party dll to the my Kentico project (I right click the Bin folder and choose add reference).When I do this, I see this page in my browser:

https://drive.google.com/file/d/0B5h41uO0sWKySkJWZ2FqYWFJVXc/view?usp=sharing

My website is running on ASP.NET 4.0 and I have tried all versions of the assembly (3.0, 4.0, 4.5), but for all I'm seeing the error message above.

Can anyone help please?

Thanks, Sia

Correct Answer

Brenden Kehren answered on February 17, 2016 07:20

In the default web.config there is a reference to Newtonsoft version 4.5. This is also a reference in the /CMSDependencies/Newtonsoft.Json.4.5.0.0 directory. Remove that dll, the web.config reference and the .dll in your bin directory, then use the NuGet package manager as Roman states to add back the version you wish.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Siavash Mortazavi answered on February 16, 2016 22:07

BTW, same .dll is working fine on my local ASP.NET project.

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on February 16, 2016 22:51

I'd recommend adding it with Nuget package manager/console.

Check you web.config file: there should be appropriate section added - make sure everything is correct there.

2 votesVote for this answer Mark as a Correct answer

Siavash Mortazavi answered on February 17, 2016 15:48

Thanks for replies, now the .dll is imported correctly.

Now the other important question is: How can I push the dll to production website? (The original website is live, and this is a new feature I'm adding, and I'm working on my local copy on my machine.)

I think since now the dll is placed correctly, I can just copy the file and update the web.config, right?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 18, 2016 21:41

Technically speaking your instructions sound correct. I'm unsure if you have a precompiled website or not but you may need to precompile it prior to deploying it.

2 votesVote for this answer Mark as a Correct answer

Siavash Mortazavi answered on February 19, 2016 13:46

Brenden, Thanks for the reply.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.