Home
Options

Error 404 when trying to use custom nuget package source

Hi,

I recently upgraded to the premium version and tried to configure our company's nuget repository. Whenever I try to select this package source I get the following error:
NuGet.Core threw an exception: The remote server returned an error: (404) Not Found.
The proxy settings of LINQPad are configured correctly - when clicking the test button it states "Successful!"

I can access the nuget feed in question both from the browser and from Visual Studio without any problems.

What am I doing wrong here?

Best regards,
Markus

Comments

  • Options
    LINQPad relies on the NuGet.Core library for downloading packages and handling proxies. NuGet.Core is itself available on NuGet.

    You can test your configuration against this directly by running the following query:
    http://share.linqpad.net/35tnvj.linq

    Do you get the same error?
  • Options
    Thank you for your reply Joe. I found the solution - the problem was entirely on my side.

    I configured a proxy that is used to access the internet and tried to access a URL that is located in the intranet of my company. The proxy configuration on our PCs (configured using a *.pac script) excludes intranet URLs and thus accessing these resources works fine. I removed the custom proxy configuration in LINQPad and reset it to auto detection and now I can access both the official nuget feed and our local feed.

    There is one issue however which I am not sure is a bug: When I set the proxy settings to auto configure and then click "Test" I receive a 407 Proxy authenticaion required error.

    Trying to simply access a file using the following snippet fails with the same exception:
    var client = new WebClient();
    client.DownloadFile(@"http://www.linqpad.net/linqpadmed.png", @c:\linqpad.png);
    Summary:Accessing nuget works fine now, but is there any way to configure the proxy authentication without specifying the proxy manually (e.g. using a proxy auto configuration script)?



  • Options
    Do any of the solutions suggested below work for your use of WebClient?

    http://stackoverflow.com/questions/16966486/how-can-i-get-webclient-webservice-client-to-automatically-use-the-default-pro

    If so, I can make LINQPad do the same.
  • Options
    Thank you for your reply!

    For the first part of my question (clicking the "Test" button in LINQPad's proxy configuration) one of the StackOverflow solutions works fine. Simply add
    <system.net>
    <defaultProxy useDefaultCredentials="true" />
    </system.net>
    to the LINQPad.exe.config file.

    For all those trying to use a WebClient in LINQPad with the default proxy in combination with the credentials of the current user:
    using (var webClient = new WebClient())
    {
    webClient.Proxy = WebRequest.GetSystemWebProxy();
    webClient.Proxy.Credentials = CredentialCache.DefaultCredentials;
    webClient.DownloadFile(@"http://www.linqpad.net/linqpadmed.png", @c:\linqpad.png);
    }
    But this again is only half the solution in my case.
Sign In or Register to comment.