I pasted the code from http://www.codeproject.com/Tips/789481/Bridging-the-Gap-between-Linqpad-and-Visual-Studio into Visual Studio 15. It tells me that 'Newtonsoft' could not be found. I open the folder "\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies" and found that the file Newtonsolft.Json.dll is already there. Could anyone tell me how to fixed problem?
Solution Explorer->Right Click on Project Name -> Click on Manage Nuget Packages -> Search for newtonsoft -> Click on install button
Go to Tools -> Library Package Manager -> Package Manager Console
and in the console just write Install-Package Newtonsoft.Json -Version 9.0.1
For me I had the package already installed but it was missing the references and it could not be added.
Helped me: in NuGet Package Manager to downgrade and upgrade Newtonsoft.Json
You have to get the correct NuGet package. From your link:
You can open the NuGet package manager in: Tools -> Nuget Packet Manager -> Manage Nuget Packages for Solution..
I had a similar problem and Google API's had a dependency on Newtonsoft.Json, not allowing me to uninstall Newtonsoft.Json and trying to reinstall.
Removing and and reinstalling Newtonsoft.Json will likely solve the problem, but in my situation, I had to go into Nuget Package Manager -> find Newtonsoft.Json -> select Options dropdown -> check "Force uninstall even if there are dependencies on it".
Checking that box allowed me to remove and subsequently reinstall Newtonsoft and the solution properly referenced it after.
I had the same problem with visual studio 2019. Simply restarting visual studio fixed the issue.
After restarting, the References list in Solution Explorer did show the "Newtonsoft.json".
Right click on the client project side and select Manage NuGet packages.
Then search for Newtonsoft.Json on browse and install.
If the class you are trying to use Newtonsoft is in client you must install the package for the client.
Related
I am trying to make Newtonsoft.json available for use in my local Visual Studio 2010 projects. I installed NuGet.Tools on my system. Now I see an item in the Solution Explorer called Service References that wasn't there before, but I don't understand how to use that to reference the Newtonsoft package I also downloaded, which is currently in my Downloads folder. Do I need to move the package to a different location to reference it?
Thanks for your help.
You can right click on the project where you want to install newtonsoft nuget package.
You will find an option "Manage NuGet packages".
Then search online for "newtonsoft".
This would add a packages.config file in your project (depending on which framework you are targeting to ).
this new file contains all the nuget dependencies required for this project.
Refer this blog for more details
VS2010 is old and is unable to update to the latest NuGet version. This means that adding recent packages will often fail; however, you can often add an older version of a package that has a compatible NuGet version and it will work. This causes the suggested answer by #ManojChoudhari to fail for me. In the case of Newtonsoft.Json, the following worked using the Package Manager Console:
Install-Package Newtonsoft.Json -Version 9.0.1
I got an error
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
while building my solution. Package manager can't restore my 2 projects:
Unable to find project information for 'C:\(...)\MultiLinker.Courier.Dext.Model.csproj'. The project file may be invalid or missing targets required for restore.
In tools I allow package manage to download packages:
Ran into the same issue. In my case, it was because Visual Studio only had the Offline Package source and could not resolve the packages I needed. I added in the nuget.org source as shown below in the NuGet Package Manager settings and right clicked on the solution and selected restore packages. and it resolved the issue.
open Nuget Package Manager -> Package Source > Add https://nuget.org/api/v2
I might be forgetting some steps, but a crucial step for me to fix this was running nuget restore from the commandline (Trying to restore from Visual Studio UI was not sufficient for some reason).
I also added a plugins folder given to me by a teammate to my .nuget folder that supposedly makes it handle our credentials automatically, so if you are having this issue maybe that is something you are missing as well.
In my case it was my Company DevOps credentials being out of date
Account Settings > Change credentials in the dialog that opens
On Visual Studio Code (VSCode) this can be solved this way:
dotnet new nugetconfig
thank you it works fine
and solved all issues of nuget
by creating the new value in the setting of nuget
under tools > nuget package manger > package manger settings
nuget package sources
add new value nuget.org and https://www.nuget.org/api/v2/
then save and update you project
it will work
The nuget restore did not work for me but once I used nuget.org it worked just fine. This was the best solution for me.
Upgrading my out of date Visual Studio helped for me:
Help Menu: Check for Updates...
I downloaded Newtonsoft.Json.11.0.2 package by package manager console,
and it certainly showed that the package is installed in project.
However, when I try to use the package
using Newtonsoft.Json
visual studio keeps warning me the name is not found and draws red underline.
What should I do? uninstalling and reinstalling the package didn't work.
Make sure you have selected same project while installing package
Add a reference by clicking on your project in the solution explorer with right click -> References -> Newtonsoft Json.
Add it and compile.
Had the same issue, i notice that i have some bll files that have been installed
Microsoft.AspNetCore.Mvc.NewtonsoftJson
Newtonsoft.Json
Newtonsoft.Json.b..
i removed all the files exept 'Newtonsoft.Json' closed the vs.code reopened it and it worked!
i'm getting following error when i build my solution in visual studio 2015.
but when i try to add that particular package then visual studio show it already added
Did you notice something? the version is different you need version 1.0.5 instead of 1.0.7
Open Nuget Package Manager and pick "Unistall" on this package, than istall it again. If this does not help you do next:
Unload project and remove all reference on this package from .csproj file
Remove reference on this package from Web.config (or App.config) if it there.
Remove reference from packages.config file
Install via nuget you package again.
Hope this helps you.
Right click solution in visual studio and select "Restore Nuget Packages", it will download the missing packages
Use the following command in the Package Manage Console:
Update-Package -reinstall -Project YourProjectName
It is by project, but this way is garanteed it works, at least in 100% of cases that happen to me.
I installed nuget using the extension manager in vs.net 2010 ultimate.
It re-started, and I still don't see the "Add Library Package Reference" menu in the tools menu.
What could be the issue?
I can only get to the powershell console and use nuget.
Library Package Reference is there in Tools, but it has only 2 options:
Package manager console
Package manager settings
I believe that this may be the default. It's the same for me and I have Ultimate 2010 too...
When I open a solution file I get additional options "Manage NuGet Package for solution"
I do get options to manage NuGet packages when I right click on a Solution file in the solution explorer. I just have to have a solution loaded.
I assumed this was how it supposed to work as I've never seen it working any other way...
If you don't have a solution/project open that supports it, you will only see those two options.