Last post Oct 08, 2019 01:27 PM by Tom.NET
Oct 07, 2019 03:55 PM|Tom.NET|LINK
I created a brand new ASP.NET Web Forms project in Visual Studio 2012. I opened the NuGet
Package Manager Console in Visual Studio and executed the following command:
PM> Install-Package SendGrid
Here is the output from this command:
Attempting to resolve dependency 'Newtonsoft.Json (≥ 9.0.1)'.
Install-Package : 'Sendgrid' already has a dependency defined for 'Newtonsoft.Json'.
At line:1 char:1
+ Install-Package SendGrid
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
My newly created ASP.NET Web Forms project does not use or have
Newtonsoft.Json in it. What is going wrong? How can I get
NuGet to install SendGrid in my ASP.NET Web Forms project?
Oct 08, 2019 06:17 AM|Yang Shen|LINK
'Sendgrid' already has a dependency defined for 'Newtonsoft.Json'.
Maybe you could try to
uninstall the Newtonsoft.Json package and then install the SendGrid again.
Please refer to below code:
PM> Uninstall-Package Newtonsoft.Json
Oct 08, 2019 06:41 AM|Tom.NET|LINK
Thank you for replying, Yang Shen.
I created a new ASP.NET Web Forms project that had no
Newtonsoft.Json package installed. Therefore, there is nothing to uninstall.
Oct 08, 2019 08:33 AM|Yang Shen|LINK
Sorry that i miss the real problem, the reason is that
vs2012 does not support .NETStandard (Used for Latest Newtonsoft Json Parser Lib.
Please change the version of your SendGrid package to an older version so that it can denpend on an older version Newtonsoft.Json package.
As i can see in my VS2017, the earlies version of SendGrid that depend on Newtonsoft.Json (>= 9.0.1) is SendGrid 7.0.7.
Thus, you can install SendGrid package whose version is ealier than 7.0.7.
PM> Install-Package SendGrid -Version 7.0.6
All below version you can try:
If possible, update your vs will be a better choice, newer version of VS provide much more convenient practice of these nuget package things.
Oct 08, 2019 01:27 PM|Tom.NET|LINK
Thank You! That is a great answer! That solved my problem.