I am trying to update the nuget references of some projects from the command line. These projects use the new format which include PackageReference elements. The command I am using is:
nuget.exe update someproj.csproj
This results in an error:
The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
Is there some way to use nuget.exe or dotnet.exe to update packages from the command line?
You will need version >= 4 of nuget.exe to work with the new csproj format.
However you will still need to use the old style
packages.configor you will get the following outputHowever you might be able to use the powershell commandlets
These can be run from the package manager console (https://learn.microsoft.com/en-us/nuget/tools/package-manager-console).
You can also just load in the powershell module and execute the following
more information on this can be found on this blog - http://community.sharpdevelop.net/blogs/mattward/archive/2011/06/12/InstallingNuGetPackagesOutsideVisualStudio.aspx