dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.91k stars 389 forks source link

.nuget config source not honoured #1081

Open colombod opened 3 years ago

colombod commented 3 years ago

in a notebook on mybinder, I run this in powershell kernel image

Despite the sources being there (user level) in the c# kernel the following code fails

image

But this one will work

image

This is what I get from PowerShell about the nuget.config settings

image

Please complete the following:

Which version of .NET Interactive are you using? image

KevinRansom commented 3 years ago

Diego,

I tried this under fsi on the macbook and the nuget behaviour seemed correct to me. Below I used dotnet nuget add source to add both sources to the per user nuget.config

And then just #r "nuget: the plotly package, and that seemed to resolve correctly.

Kevins-MacBook-Pro:~ kevinr$ dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
Package source with Name: Package source 1 added successfully.
Kevins-MacBook-Pro:~ kevinr$ dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
Package source with Name: Package source 2 added successfully.
Kevins-MacBook-Pro:~ kevinr$ dotnet nuget list source
Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  Package source 1 [Enabled]
      https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
  3.  Package source 2 [Enabled]
      https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
Kevins-MacBook-Pro:~ kevinr$ ls
Applications            Downloads           Parallels           myfile
Applications (Parallels)    Library             Pictures            repos
Desktop             Movies              Projects            temp
Documents           Music               Public              utilities
Kevins-MacBook-Pro:~ kevinr$ dotnet fsi

Microsoft (R) F# Interactive version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> #r "nuget:XPlot.Plotly.Interactive, 3.0.4";;
[Loading /var/folders/20/lhd0fcnj0zq6f1mrp21j41900000gn/T/nuget/1812--1cf8eb82-a579-4720-99ad-b80394105430/Project.fsproj.fsx]
namespace FSI_0002.Project
colombod commented 3 years ago

Does it work on binder?

colombod commented 3 years ago

You can test it with this url

KevinRansom commented 3 years ago

Okay Diego ... the issue you are running into is this. There is a nuget.config file in the Notebooks folder where you are running

dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json

So you can either remove the nuget.config and make sure that all of the sources are added using a script that runs dotnet nuget add source. Or

cd /tmp
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json

....
cd ~/Notebooks