1
votes

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.

enter image description here

Here's the nuget restore build task

enter image description here

Here's the MSBUILD step

enter image description here

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.

enter image description here

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?

2

2 Answers

1
votes

According to your screenshot. One issue I notice is that the MSBuild task is doing a restore at all. It shouldn't. Let the Nuget task do the NuGet restore.

Suggest go to Advanced options for the build task and uncheck "Restore NuGet Packages" or if there is some other way you are invoking NuGet restore during the build turn that off.

If this is not do the trick, also set variable system.debug=true to Enable Verbose Debug Mode for TFS Build vNext. Which may provide more detail info for troubleshooting.

1
votes

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.