We have an on-premise TFS 2015 build. We've recently added a reference to a 3rd party package. I have added a nuget restore
build step to our build pipeline before the MSBUILD
step to restore the package.
Here's the nuget restore
build task
Here's the MSBUILD
step
The error message I'm getting is this.
Failed to retrieve information about 'myPrivatePackage' from remote source 'https://nuget.myPrivatePackage.com/nuget/FindPackagesById()?id='myPrivatePackage'&semVerLevel=2.0.0'.
The 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.
Here's the build output log.
UPDATE
Here's the detailed TFS build log output from the nuget restore step.
Task "RestoreTask"
(in) RestoreGraphItems Count '19'
(in) RestoreDisableParallel 'False'
(in) RestoreNoCache 'True'
(in) RestoreIgnoreFailedSources 'False'
(in) RestoreRecursive 'True'
(in) RestoreForce 'False'
(in) HideWarningsAndErrors 'False'
(in) RestoreForceEvaluate 'False'
Running restore with 4 concurrent jobs.
Reading project file E:\TfsData\Build\_work\4\s\OscarWeb\OscarWeb.csproj.
Reading project file E:\TfsData\Build\_work\4\s\OscarWeb\OscarWeb.csproj.
Persisting no-op dg to E:\TfsData\Build\_work\4\s\OscarWeb\obj\OscarWeb.csproj.nuget.dgspec.json
Restoring packages for E:\TfsData\Build\_work\4\s\OscarWeb\OscarWeb.csproj...
Restoring packages for E:\TfsData\Build\_work\4\s\OscarWeb\OscarWeb.csproj...
Restoring packages for .NETCoreApp,Version=v2.2...
Restoring packages for .NETCoreApp,Version=v3.1...
GET https://www.nuget.org/api/v2/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0
GET https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration.Tools'&semVerLevel=2.0.0
Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='BuildBundlerMinifier'&semVerLevel=2.0.0'.
The 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.
Any ideas what is causing the error and how to fix it?
I have managed to get this working by using the dotnet restore
command instead of nuget restore
.
dotnet restore "MyProject.csproj" --configfile "nuget.config" --verbosity detailed --packages "rootfolder\packages" --no-cache
My 3rd party packages are now being restored as part of the build pipeline correctly.