I am trying to add a reference 'Newtonsoft.Json.dll' I have followed what he has asked. which adds this ref from 'browse' tab to 'recent' tab. If I look at the list of refs from the ref list it is listed but with a yellow flag.
When I hold the cursor over the flag it says: not available as it does not exist, or is not built?? So I have removed it from the list of ref's and try to re-add it.
It only appears in the 'recent' section and when I add it, I get:
A reference to 'Newtonsoft.Json.dll' could not be added.
Its probably something in your build system: the dll is likely getting cleaned (as in deleted by a rebuild), or is in a directory that isn't under your solution, or simply isn't getting copied to the output directory.
I'm sorry I don't have a more specific piece of advice. What I'm going to do though is suggest you use a shot-gun to kill a mosquito: use NuGet. In C# with Visual Studio (or any other .net IDE), you really want to use the nuget package manager, since it works so well.
This will put it in a library directory, include it in the build path, and allow you to use the Intelli sense to auto-add the appropriate reference from your project.
Make sure that the your project target framework is set to the correct version. It might be that your target .NET framework for the project is lower than what the Newtonsoft dll was built under. Right click on your project and see what it's set at. You'll need to go view the properties.
I had the same problem.
Nuget works, but for older Visual Studios, such as 2005/2008, it can be tricky (And that, unfortunately, was my case).
I downloaded Json.NET here. Inside binaries, choose the one that matches your .Net Framework version, add the dll inside a folder of your project (e.g. lib), and include it as a reference. Then, have fun!
OK, this is a stupid answer, but sometimes you make stupid mistakes ...: if you have several sub-projects in your solution, make sure you add the reference to the right one (or to all) !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With