dotnet / dotnet/fsharp

Referencing packages in F# Interactive doesn't work when connected to a feed requiring authentication

Open
#11,392 8 comments 3 reactions 0 assignees View on GitHub
Area-FSI Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Referencing-packages-in-F-Interactive-d/1383518)._

---
[severity:It's more difficult to complete my work]
According to the [official documentation](https://docs.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#referencing-packages-in-f-interactive), it should be possible to reference NuGet packages from an F# script file:

```
#r "nuget: Newtonsoft.Json"
open Newtonsoft.Json

let data = {| Name = "Don Syme"; Occupation = "F# Creator" |}
JsonConvert.SerializeObject(data)
```
When I try to do this, however, it doesn't work. The editor is full of red squiggly lines, the error list contains five errors, and when I send the code to F# Interactive (Alt + Enter), it prints this error message:

`Reactors.fsx(1,1): error FS3217: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(131,5): warning : The plugin credential provider could not acquire credentials. Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet` [C:\Users\mark\AppData\Local\Temp\nuget\20272--3928d5e7-1194-4146-a20d-a5f0dd5e8910\Project.fsproj]`

It's not clear how to proceed from here.

---
### Original Comments

#### Feedback Bot on 3/28/2021, 11:37 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

---
### Original Solutions
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.