nuget restore not working properly on one project

larsbrubaker's Avatar


07 Dec, 2020 07:15 PM

I have made sure this project has no visible differences than the other project we have that are working and at this point wondering if it might be a server issue. This repository has been building on AppVeyor for several years and we have not had this problem before.

Here is the console output when the error happens.

MSBuild auto-detection: using msbuild version '' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin'.
Restoring packages for C:\projects\Submodules\agg-sharp\examples\lion_outline\lion_outline.csproj...
Restoring packages for C:\projects\Submodules\agg-sharp\examples\lion\lion.csproj...
Unable to load the service index for source
  An error occurred while sending the request.
  The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
  The remote certificate is invalid according to the validation procedure.

  1. Support Staff 1 Posted by Feodor Fitsner on 07 Dec, 2020 08:41 PM

    Feodor Fitsner's Avatar

    Hi Lars,

    Last year there was a fix for failing NuGet. You might still have it in your build configuration, something like:

    [System.IO.File]::AppendAllText("C:\Windows\System32\drivers\etc\hosts", "`n93.184.221.200`")

    This fix is not needed anymore.

  2. 2 Posted by larsbrubaker on 07 Dec, 2020 10:04 PM

    larsbrubaker's Avatar

    Yes that was in the install script, but I removed it (to match the other building projects) and it did not resolve the issue.

    The current content of the Install Script is:

    git submodule update --init --recursive
    nuget restore agg-sharp.sln

    Thanks for looking at this.

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Dec, 2020 10:34 PM

    Feodor Fitsner's Avatar

    Could you drop a link to a build please?

  4. 4 Posted by larsbrubaker on 07 Dec, 2020 10:47 PM

    larsbrubaker's Avatar

    Thank you for looking into this.

    Is this the link you need?

    I just pushed this and it failed in the same way.

  5. Support Staff 5 Posted by Feodor Fitsner on 07 Dec, 2020 11:57 PM

    Feodor Fitsner's Avatar

    Alright, you have defined in HOSTS on Environment tab of project settings.

  6. 6 Posted by larsbrubaker on 08 Dec, 2020 12:29 AM

    larsbrubaker's Avatar

    Removing that seems to have fixed the problem. Thank you.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac