locked
Attempting to Install SendGrid in an ASP.NET Web Forms Visual Studio Project Stops with Error RRS feed

  • Question

  • User107954528 posted

    Hello Everyone, 

    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?  

    Monday, October 7, 2019 3:55 PM

Answers

  • User-719153870 posted

    Hi Tom.NET,

    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.

    For example,

    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.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 8, 2019 8:33 AM

All replies

  • User-719153870 posted

    Hi Tom.NET,

    '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

    Best Regard,

    Yang Shen

    Tuesday, October 8, 2019 6:17 AM
  • User107954528 posted

    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.  

    Tuesday, October 8, 2019 6:41 AM
  • User-719153870 posted

    Hi Tom.NET,

    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.

    For example,

    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.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 8, 2019 8:33 AM
  • User107954528 posted

    Thank You!  That is a great answer!  That solved my problem.  laughing

    Tuesday, October 8, 2019 1:27 PM