I m publishing NuGet package. I ve installed latest version of Visual Studio 2017 Community. I get the following error:
Failed to process request. 'A client version '4.1.0' or higher is required to be able to push packages. Please contact support@nuget.org to get more details.'.
Why latest Visual Studio cannot publish NuGet? How to fix it? The full build log is below:
1>------ Rebuild All started: Project: MyProject.NuGet, Configuration: Release Any CPU ------
1> MyProject.NuGet -> C:\Users\User\Documents\MyProject\MyProject.NuGet\bin\Release\MyProject.NuGet.dll
1>
1> NuGet Packager 2.0.3
1>
1> Creating backup...
1> Renamed MyProject.1.0.6.nupkg to MyProject.1.0.6.nupkg.bak
1>
1> Updating NuGet...
1> The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd' has invalid child element 'developmentDependency' in namespace 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd'. List of possible elements expected: 'releaseNotes, projectUrl, title, language, iconUrl, dependencies, frameworkAssemblies, tags, references, licenseUrl, summary, copyright, description' in namespace 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd'.
1> Checking for updates from https://nuget.org/api/v2/.
1> Currently running NuGet.exe 2.2.0.
1> Updating NuGet.exe to 4.4.1.
1>
1> Creating package...
1> Attempting to build package from 'Package.nuspec'.
1> Id: MyProject
1> Version: 1.0.6
1> Authors: Boris Zinchenko
1> Description: MyProject
1> License Url: MyProject
1> Project Url: MyProject
1> Tags: MyProject
1> Dependencies:
1> Added file 'lib\net20\MyProject.dll'.
1> Added file 'tools\init.ps1'.
1> Added file 'tools\install.ps1'.
1> Added file 'tools\uninstall.ps1'.
1> Successfully created package 'MyProject.1.0.6.nupkg'.
1>
1> Publishing package...
1> Repository Url: https://www.nuget.org
1>
1> Pushing MyProject 1.0.6 to the NuGet gallery (https://www.nuget.org)...
1> Failed to process request. 'A client version '4.1.0' or higher is required to be able to push packages. Please contact support@nuget.org to get more details.'.
1>EXEC : The remote server returned an warning : (400) Bad Request..
1> Pushing MyProject 1.0.6 to the NuGet gallery (https://www.nuget.org)...
1> Failed to process request. 'A client version '4.1.0' or higher is required to be able to push packages. Please contact support@nuget.org to get more details.'.
1>EXEC : The remote server returned an warning : (400) Bad Request..
1>
1> Exit Code: 0
1>
1> Build Exit Code: -1
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Update
After valuable advise by @Alexei Levenkov, I ve updated NuGet version using command: Install-Package NuGet.VisualStudio
. Surprisingly, it did not make any effect on my error and the error still remains the same. The log of update from NuGet console is below.
Package Manager Console Host Version 4.5.0.4685
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package NuGet.VisualStudio
Attempting to gather dependency information for package 'NuGet.VisualStudio.4.5.0' with respect to project 'MyProject', targeting '.NETFramework,Version=v2.0'
Gathering dependency information took 20.7 ms
Attempting to resolve dependencies for package 'NuGet.VisualStudio.4.5.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'NuGet.VisualStudio.4.5.0'
Resolved actions to install package 'NuGet.VisualStudio.4.5.0'
Retrieving package 'NuGet.VisualStudio 4.5.0' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/nuget.visualstudio/4.5.0/nuget.visualstudio.4.5.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/nuget.visualstudio/4.5.0/nuget.visualstudio.4.5.0.nupkg 524ms
Installing NuGet.VisualStudio 4.5.0.
Adding package 'NuGet.VisualStudio.4.5.0' to folder 'C:\Users\User\Documents\MyProject\packages'
Added package 'NuGet.VisualStudio.4.5.0' to folder 'C:\Users\User\Documents\MyProject\packages'
Added package 'NuGet.VisualStudio.4.5.0' to 'packages.config'
Successfully installed 'NuGet.VisualStudio 4.5.0' to MyProject
Executing nuget actions took 5.01 sec
Time Elapsed: 00:00:07.1699206