NuGet - LinqPad 5 uses official nuget even though disabled

Hi,
I hope someone can help. I have my own NuGet repository, and this is enabled (using Linqpad NuGet Manager => Settings). The "NuGet3 official package source" is disabled.

When I attempt to download a package (from my own repo), I get the following exception:


Error downloading 'package name here' - Unable to load the service index for source https://api.nuget.org/v3/index.json.



https://api.nuget.org/v3/index.json - this is the source for the official NuGet repo, not my repo.


Anyone know how to get round this?

Many thanks.

Chris

Comments

  • NB: Using LINQPad 4, I don't have this problem.
  • Same Problem here. The Firewall is blocking the communication to https://api.nuget.org/v3/index.json but we are not able to disable the default package in the GUI.

    I have disabled the default NuGet Package Source, but version 5 is still trying to geht packages details from the disabled default source. Thus resulting in an error being unable to download NuGet Packes from our local source.

    With version 4 we don't have this issue, it appears only in version 5.
  • I've just tried using Windows Firewall to block IP address 117.18.232.200 (api.nuget.org) and can still download from other sources.

    Are you certain you've unchecked the default source?
  • Yes, we are not able to delete the default source, but it is unchecked.
    Works in version 4, but not in 5.

    Sadly this makes version 5 unusable for us.
  • We can search the Linqpad NuGet Managers packages, but as soon as we hit the button "Add To Query" the following error apperars:

    Error downloading 'packageName' - Unable to load the service index for source https://api.nuget.org/v3/index.json

    We are using ProGet Version 3.8.6 (Build 2) for our local repository.
  • I've tried installing Fiddler, and downloading a NuGet package from a custom MyGet source. I can't find any HTTP traffic to api.nuget.org in the log.

    Can you try doing the same?
  • I just did, i can see that the request from version 4 to 5 is different, as soon as you hit the "Add To Query" Button in the Nuget Browser.

    Version 4:
    GET /nuget/STORM/Packages(Id='Newtonsoft.Json',Version='9.0.1') HTTP/1.1
    done:

    Version 5:
    GET /nuget/STORM/FindPackagesById()?id='Newtonsoft.Json' HTTP/1.1
    CONNECT api.nuget.org:443 HTTP/1.1

    This is a Tunnel to request


    Raw:
    CONNECT api.nuget.org:443 HTTP/1.1
    Host: api.nuget.org
    Proxy-Connection: Keep-Alive

    A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.

    Version: 3.1 (TLS/1.0)
    Random: 59 1E 9B DB 54 F8 79 B3 44 C0 13 18 79 5C 57 24 C7 D0 D7 8E B4 3E 9A F5 49 A3 04 BD 49 6A 38 22
    "Time": 02.10.2086 07:49:13
    SessionID: 0D 0C 00 00 05 4E E2 FF FA BC 77 94 C7 FD EE CC 07 52 C9 B6 E5 79 B3 71 70 32 88 28 62 13 D8 14
    Extensions:
    server_name api.nuget.org
    elliptic_curves secp521r1 [0x19], secp256r1 [0x17], secp384r1 [0x18]
    ec_point_formats uncompressed [0x0]
    extended_master_secret empty
    renegotiation_info 00
    Ciphers:
    [C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA
    [C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA
    [C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
    [C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
    [0035] TLS_RSA_AES_256_SHA
    [002F] TLS_RSA_AES_128_SHA
    [0038] TLS_DHE_DSS_WITH_AES_256_SHA
    [0032] TLS_DHE_DSS_WITH_AES_128_SHA
    [000A] SSL_RSA_WITH_3DES_EDE_SHA
    [0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
    [0005] SSL_RSA_WITH_RC4_128_SHA
    [0004] SSL_RSA_WITH_RC4_128_MD5

    Compression:
    [00] NO_COMPRESSION




  • Does Fiddler also show contact with the ProGet server?
  • Hello Joe, version 5.22.02 - still same issue. Production server without internet can't use local nuget packages. Same error as above - linqpad 5 trying to reach default NuGet url. Version 4 is working properly.
  • edited August 2017
    I've followed the instructions here to create my own local NuGet feed:
    https://docs.microsoft.com/en-us/nuget/hosting-packages/nuget-server

    and configured it in LINQPad as follows:
    image
    https://www.dropbox.com/s/mcuxkucvgya5rbp/NuGetCustomFeed.png?dl=0

    This works, even when disconnected from the Internet. Have you configured it in a similar way?
  • Thank you for fast answer! What I wanted is to add NuGet feed by specifying local folder with nuget packages at production server (working only for 4th version). I used to add new packages to this folder by copy-paste. Mentioned above approach is not the most convenient for a jump server without devs infrastructure, connection to devs Nuget feed or internet, but with a lot of security rules.
  • edited December 2017
    Seeing this same behaviour as well.

    I have a Windows 7 desktop which is working fine offline.

    In the LINQPad NuGet Manager I have the (default) repo in the 2nd position and disabled.
    For 1st position I have a local folder "C:\Code\_Local NuGet Repo" in which all my ".nupkg" files sit.

    I copy any new ones from my cache folder into this location.

    LINQPad 5 works just fine when the internet is not connected on the desktop. I confirmed ZERO http requests with fiddler while attempting to add packages.

    This same configuration works from Visual Studio 2015 as well both via the NuGet GUI and Package Manager Console.

    I try this same setup on my Windows 8.1 install and I get the error saying it can't contact the nuget server.
    Fiddler also shows the http requests trying to get out.

    image

    The nuget.org domain seems to match the machine wide setting in VS 2015, which is also disabled btw. (Edit: I only managed to get this error once - since then it has been api.nuget.org - so not sure what that was about)

    So I tried what Joe recommended (setting up the local http based NuGet server as per the MS docs).
    I downloaded and configured "NuGet.Server 3.0.2". Deployed to local IIS and tested with the browser - got XML feed. Tested with visual studio 2015 package manager console - got successful install.

    image

    Changed the Windows 8.1 install of LINQPad from "C:\Code\_Local NuGet Repo" to point to the local web server feed "http://localhost/nuget-local/nuget".

    LINQPad can see the packages there. It can even see multiple versions when I use the down-arrow to the right of the Add Query test on the button.

    image

    It still fails to install when you click Add to Query. The error is consistent between the file and http based repos.

    image

    So to summarise, when offline, the http and folder based repos both work in VS 2015 and LINQPad 5 on the Windows 7. On Windows 8.1 both http and folder based repos work in VS 2015 but both fail in LINQPad 5.
  • PS. Found this stack trace in the LINQPad log folder:

    5.26.01(AnyCPU) 2017-12-24T14:57:36.9068969+10:30 CheckForNuGetUpdates -
    FatalProtocolException: Unable to load the service index for source https://api.nuget.org/v3/index.json.
    at LINQPad.TaskExtensions.GetResult[T](Task`1 t)
    at LINQPad.Interop.NuGet.NuGetAgent.GetLatestVersionsOfLocalPackages(NuGetRepositoryRoot[] localPackages)
    at LINQPad.UI.NugetManager.StartCheckForUpdates()
    INNER: HttpRequestExceptionAn error occurred while sending the request. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.ServerWarningLogHandler.d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.StsAuthenticationHandler.d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.HttpSourceAuthenticationHandler.d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.TimeoutUtility.d__0`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.HttpRetryHandler.d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.HttpSource.d__16.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0`1.<<GetAsync>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Common.ConcurrencyUtilities.d__2`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.HttpSource.d__12`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.ServiceIndexResourceV3Provider.d__9.MoveNext()
    First chance data: LINQPad.Interop.NuGet.NuGetAgent+d__27.MoveNext() offset=0xB2
    -LINQPad.Interop.NuGet.NuGet3Installer+d__6.MoveNext() offset=0xED
    -LINQPad.TaskExtensions+d__13`1.MoveNext() offset=0x148
    -NuGet.Protocol.Core.Types.SourceRepository+d__16`1.MoveNext() offset=0xB8
    -NuGet.Protocol.V3FeedListResourceProvider+d__1.MoveNext() offset=0x82
    -NuGet.Protocol.Core.Types.SourceRepository+d__16`1.MoveNext() offset=0xB8
    -NuGet.Protocol.ServiceIndexResourceV3Provider+d__8.MoveNext() offset=0x21B
    -NuGet.Protocol.ServiceIndexResourceV3Provider+d__9.MoveNext() offset=0x20B
    -NuGet.Protocol.HttpSource+d__12`1.MoveNext() offset=0x0
    -NuGet.Common.ConcurrencyUtilities+d__2`1.MoveNext() offset=0x0
    -NuGet.Protocol.HttpSource+<>c__DisplayClass12_0`1+<<GetAsync>b__0>d.MoveNext() offset=0x2B4
    -NuGet.Protocol.HttpSource+d__16.MoveNext() offset=0x1A2
    -NuGet.Protocol.HttpRetryHandler+d__0.MoveNext() offset=0x2A7
    -NuGet.Protocol.TimeoutUtility+d__0`1.MoveNext() offset=0x0
    -System.Net.Http.HttpClient.SetTaskFaulted(request,cancellationTokenSource,tcs,e) offset=0x18
    -System.Net.Http.HttpClient+<>c__DisplayClass11.b__12(task) offset=0x19
    -NuGet.Protocol.HttpSourceAuthenticationHandler+d__9.MoveNext() offset=0xC4
    -NuGet.Protocol.StsAuthenticationHandler+d__9.MoveNext() offset=0xBF
    -NuGet.Protocol.ServerWarningLogHandler+d__1.MoveNext() offset=0x88
    -System.Net.Http.HttpClientHandler.HandleAsyncException(state,e) offset=0x54
    -System.Net.Http.HttpClientHandler.GetResponseCallback(ar) offset=0xC
    -System.Net.LazyAsyncResult.Complete(userToken) offset=0x3E
    -System.Net.ContextAwareResult.CaptureOrComplete(cachedContext,returnContext) offset=0x8C
    -System.Net.ContextAwareResult.FinishPostingAsyncOp() offset=0x1F
    -System.Net.HttpWebRequest.BeginGetResponse(callback,state) offset=0x1C0
    -System.Net.Http.HttpClientHandler.StartGettingResponse(state) offset=0x46
    -System.Net.Http.HttpClientHandler.StartRequest(obj) offset=0x2A

    LINQPad.TaskExtensions.GetResult(t) offset=0x84
    -LINQPad.Interop.NuGet.NuGetAgent.GetLatestVersionsOfLocalPackages(localPackages) offset=0x7
    -LINQPad.UI.NugetManager.StartCheckForUpdates() offset=0x4C
  • Could you try running this query and post the result:

    http://share.linqpad.net/4rkaag.linq
  • Hi Joe,

    I've run the script on the Windows 7 install and on the Windows 8.1 setup.

    1. Windows 7:

    image

    2. Windows 8.1 (file based nuget repo):

    image

    * Note: in the above screen shot you will notice the 2nd repo (the nuget org one) is enabled - that was my mistake - tried enabling it to see if it made a difference to how the package manager detects if it needs to go online or not .. didn't make a difference. On or off I get the same result.

    3. Windows 8.1 (http based nuget repo):

    image

    If you compare shots 1 and 3, there's not much difference between those variables other than the location (file vs http) of that Local NuGet Repo.
  • Same Problem Here.

    All is well configured, but version 5 just won't let me download from the local source. With Version 4 it works like charm.

    We are a team of nine developers and we are really looking forward to get this issue fixed with the next release.

    image
  • Thanks for all the info. After further investigation, I've found a potential cause and have uploaded a new beta:
    http://www.linqpad.net/download.aspx#beta

    Let me know if this fixes the problem.
  • Hi JoeAlbahari,

    you made a team of developers very happy!
    Finally we are able to use the latest version with nuget support.

    The latest Beta fixed the issue and we are very happy.
  • edited February 14
    Updated to the beta and now both http and file based NuGet repositories are working great.

    I've said it before and I'll say it again: @JoeAlbahari you are a lovely man :smile:
  • Terrific. I'm glad that worked!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!