What platforms must a NuGet package support to be loaded in a Console workbook ?

MattLaceyMattLacey GBUniversity, Developer Group Leader ✭✭

In trying to add NuGet packages to a Console workbook some packages fail to be added and no error or failure message is displayed.
Packages in question target just NF4.6.2 & NetStandard2.0 so I assume it's a targeting issue.

  1. What platforms must a package target to work with a console workbook?
  2. Where is best to make the suggestion for better error handling and exception reporting in this scenario?

Best Answer

Answers

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    You probably need to be using Workbooks 1.3. An RC is available for download at https://developer.xamarin.com/releases/interactive/interactive-1.3/ (or you can switch your update channel to alpha or beta).

  • MattLaceyMattLacey GBUniversity, Developer Group Leader ✭✭

    Using v1.3 RC2 I can now add the reference to the package in the workbook but I still can't use it.

    It's my own NuGet package and I want to use WorkBooks to create some docs but can't.
    ApiAnalysis.SimpleJsonAnalyzer version: 1.1.0

    In the code block, I get a red underline on the #r line with the message "Metadata file ApiAnalysis could not be found."

    The library works fine when referenced in NetCore2 apps and libraries (and the NF462 version works fine there) but I can't reference and use it in a workbook.
    What do I need to get it to work in a workbook?

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    (And yes, we should and will improve the user experience around users installing NuGet packages that can't be referenced in the current workbook)

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    Another option would be to totally drop the NF462 assembly, and then any app targeting .NET Framework 4.6.1 or later would just automatically reference the .NET Standard assembly.

    I find it strange that NuGet won't fall back to the .NET Standard assembly in the existing package, but I tested in VS 15.3 and it has similar behavior. The install errors-out because "the package does not contain any assembly references or content files that are compatible with that framework". In Workbooks, we allow package installs like this to "succeed", because we do support changing your target platform. But as I said, this is clearly not in the best UX place yet.

    Thanks for bringing this scenario to our attention!

  • MattLaceyMattLacey GBUniversity, Developer Group Leader ✭✭

    I added a version of the package targeting .Net 4.5 and now it works great. Thanks.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    Glad to hear it!

Sign In or Register to comment.