locked
Trying to install GraphQL and getting red error in Console RRS feed

  • Question

  • Hi,

    I apologize if this is not the right forum for my question but I'm not sure where exactly to ask (I did add a comment to the article). I'm trying to follow this interesting article I'm reading right now:

    https://www.red-gate.com/simple-talk/dotnet/net-development/building-and-consuming-graphql-api-in-asp-net-core-3-1

    I have Visual Studio 2019 16.6.4 right now. When I tried to install following the article I got an error about NewtonSoft.JSON being not compatible with netcore 3.1 (the second install did install correctly).

    This is the exact error (I re-tried it now again after I've installed version 16.6.4):

    Install-Package : NU1202: Package Newtonsoft.Json 10.0.3 is not compatible with netcoreapp3.1 
    (.NETCoreApp,Version=v3.1). Package Newtonsoft.Json 10.0.3 does not support any target frameworks.
    At line:1 char:1
    + Install-Package GraphQL
    + ~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackag 
       eCommand
     
    Install-Package : Package restore failed. Rolling back package changes for 'MvcMovie'.
    At line:1 char:1
    + Install-Package GraphQL
    + ~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackag 
       eCommand
     

    I did a very quick Google Search, but it seemed to refer to different package. What am I supposed to do?

    Thanks in advance.


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles


    • Edited by Naomi N Wednesday, July 15, 2020 10:48 PM
    Wednesday, July 15, 2020 10:45 PM

Answers

  • Ok, not sure if I should just delete this message or leave it in case it will help someone else. After finding this https://stackoverflow.com/questions/46037274/fix-for-package-xxx-is-not-compatible-with-netcoreapp2-0-netcoreapp-version-v I just went ahead and installed the latest version of Newtonsoft.Json by using Tools/Nuget Package Manager. After that I was able to install it fine.

    Will hopefully continue with the article in a bit.

    BTW, Auntie Emma syndrome all over again - as soon as I put the problem in words, I usually try to solve it myself too and often it works.


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles


    • Edited by Naomi N Wednesday, July 15, 2020 11:01 PM
    • Marked as answer by Naomi N Wednesday, July 15, 2020 11:02 PM
    • Unmarked as answer by Naomi N Thursday, July 16, 2020 2:01 AM
    • Marked as answer by Naomi N Thursday, July 16, 2020 3:48 AM
    Wednesday, July 15, 2020 10:59 PM