Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "NU3034 This package is signed but not by a trusted signer"

Today I found myself unable to restore NuGet packages on my machine. Doing so produces errors resembling:

Myproject.csproj : error NU3034: Package 'SomePackage 1.2.3' from source 'https://api.nuget.org/v3/index.json': This package is signed but not by a trusted signer.

How can I fix package restore?

like image 750
Drew Noakes Avatar asked May 28 '19 03:05

Drew Noakes


2 Answers

Running nuget trusted-signers list showed I had one trusted signer by the name of "NuGet Test Developer".

This was present in %appdata%\NuGet\NuGet.Config under the <trustedSigners> node.

Commenting out the entire <trustedSigners> node allowed restore to complete successfully.

It may also be possible to use nuget trusted-signers Add -Name nuget.org to explicitly trust packages from nuget.org, but in my case I don't believe I need the "NuGet Test Developer" signator.

It may also be possible to use nuget config -set signatureValidationMode=accept to disable signature validation altogether.

I found this article useful for learning more about NuGet package signing.

like image 112
Drew Noakes Avatar answered Sep 17 '22 06:09

Drew Noakes


If someone tried everything said by Drew Noakes, but still is getting error you can also try running command:

nuget trusted-signers sync -Name <name>

Which fixed this error for me.

Here is link to documentation.

like image 23
Blank Avatar answered Sep 21 '22 06:09

Blank