A list of packages on the nuget.org site is displayed.
Error occured:\nThe input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
I have used nuget on this environment before, but a number of days ago. I have no other extensions installed except those directly installed with Visual Studio.
Windows 10, Using VS2015 Update 1, occurs in .NET 5 and .NET Core apps.
Nuget: v3.3.0.167 (there are no updated available)
My Nuget.Config (default as far as I know):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<!--
Used to specify the default location to expand packages.
See: NuGet.exe help install
See: NuGet.exe help update
-->
<add key="repositoryPath" value="External\Packages" />
<!--
Used to specify default source for the push command.
See: NuGet.exe help push
-->
<add key="DefaultPushSource" value="http://MyRepo/ES/api/v2/package" />
<!--
Proxy settings
-->
<add key="http_proxy" value="host" />
<add key="http_proxy.user" value="username" />
<add key="http_proxy.password" value="encrypted_password" />
</config>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<!--
Used to specify the default Sources for list, install and update.
See: NuGet.exe help list
See: NuGet.exe help install
See: NuGet.exe help update
-->
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<!-- used to store credentials -->
<!-- Used to specify which one of the sources are active -->
<!-- Used to disable package sources -->
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
</disabledPackageSources>
<!--
Used to specify default API key associated with sources.
See: NuGet.exe help setApiKey
See: NuGet.exe help push
See: NuGet.exe help mirror
-->
<apikeys>
<add key="http://MyRepo/ES/api/v2/package" value="encrypted_api_key" />
</apikeys>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
</configuration>
@brainwipe thanks for this report
Can you try a few things
CC @maartenba @xavierdecoster
Thanks for getting back to me.
Are there any other diagnostics I can help with?
That's odd, do you have https setup for fiddler? You are definitely getting an answer from somewhere given the error log.
Also best start Fiddler before starting VS so it uses Fiddler as the proxy. Some tips in our docs https://docs.nuget.org/consume/nuget-faq#managing-packages-in-nuget.org
Also what happens when you paste the URL into a browser?
Thanks for the feedback.
{
"version": "3.0.0-beta.1",
"resources": [
{
"@id": "https://api-v3search-0.nuget.org/query",
"@type": "SearchQueryService",
"comment": "Query endpoint of NuGet Search service (primary)"
},
// snip
I'm a bit stumped, I have never seen something like this. Would you be kind enough to attach a debugger, and get the callstack from where this is throwing and perhaps a bit more clues?
I have a solution!
Cause: Corrupted %appdata%/nuget.config
Warning: this solution will remove any custom config you might had added, such as additional package sources and proxy config.
%appdata%/NugetNuGet.Config out of the folderUninstalling Visual Studio NuGet extension does not delete the NuGet.config file. This is completely reasonable (expected) behaviour. Downside is that if this file is corrupted (as mine was) then you must delete manually.
I don't know what caused the corruption. I tried killing the Visual Studio process while performing NuGet config or using non-standard characters in package source names but I can't see the dodgy character in my config file.
A final thank you to the community for your help, it was much appreciated. Leaving this full solution here in case anyone else has a similar problem. Problem closed!
@brainwipe Thanks for the solution. Just wanted to add that in my case I didn't have to reinstall the NuGet extension. I just deleted/moved the config file from %appdata% and restarted VS.
Most helpful comment
@brainwipe Thanks for the solution. Just wanted to add that in my case I didn't have to reinstall the NuGet extension. I just deleted/moved the config file from %appdata% and restarted VS.