You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to add Newtonsoft.Json nuget package using #r "nuget: Newtonsoft.Json" on csharprepl and I got this error:
Description
You can have many sources enabled in nuget configuration (you can list them by running nuget sources or dotnet nuget list source commands)
but some of them (for example company private package sources) may not be accessible sometimes (authentication or vpn may be needed, etc.).
nuget.org should always be a safe and accessible source, but if the nuget command tries an inaccessible one it fails
I don't know how it works but the nuget add command requires a source as an argument, but the dotnet add packagedoes not, it is optional so I am guessing that it iterates over all sources maybe? I really don't know. I do know that you can enable and disable sources via command line or editing the nuget config xml file, but it is kind of annoying
The error with csharprepl today was because it tried to access my company's private repo and got an auth error
I get the same error when I use dotnet add package command directly:
Feature Request
It is possible to extend the #r command to accept a source or do something like --ignore-failed-sources on dotnet restorecommand?
The text was updated successfully, but these errors were encountered:
I spent some time looking into this, and ultimately we're blocked on NuGet/Home#7304 / NuGet/Home#5643. There's a very promising looking SourceCacheContext.IgnoreFailedSources property available to us, but the underlying NuGet APIs don't actually respect it.
A potential workaround (untested) would be to reorder the sources in the NuGet.config file -- from what I can tell they're tried in the same order that they're listed in the file.
Feature Description
Context
I tried to add
Newtonsoft.Json
nuget package using#r "nuget: Newtonsoft.Json"
oncsharprepl
and I got this error:Description
You can have many sources enabled in nuget configuration (you can list them by running
nuget sources
ordotnet nuget list source
commands)but some of them (for example company private package sources) may not be accessible sometimes (authentication or vpn may be needed, etc.).
nuget.org should always be a safe and accessible source, but if the nuget command tries an inaccessible one it fails
I don't know how it works but the
nuget add
command requires a source as an argument, but thedotnet add package
does not, it is optional so I am guessing that it iterates over all sources maybe? I really don't know. I do know that you can enable and disable sources via command line or editing the nuget config xml file, but it is kind of annoyingThe error with
csharprepl
today was because it tried to access my company's private repo and got an auth errorI get the same error when I use
dotnet add package
command directly:Feature Request
It is possible to extend the
#r
command to accept a source or do something like--ignore-failed-sources
ondotnet restore
command?The text was updated successfully, but these errors were encountered: