The 'UmbracoCms.Core 7.6.5' package requires NuGet client version '3.4.4' or above, but the current NuGet version is '2.8.1.0' - nuget

Intro
I am trying to create a project from the cloud using "UaaS.cmd".
I run it, fill the url and namespace and it start working. Then in the middle of the process I get the error:
Installing UmbracoCms.Core
The 'UmbracoCms.Core 7.6.5' package requires NuGet client version '3.4.4' or above, but the current NuGet version is '2.8.1.0'.
at NuGet.PackageWalker.CheckPackageMinClientVersion(IPackage package)
at NuGet.PackageWalker.Walk(IPackage package)
at NuGet.InstallWalker.ResolveOperations(IPackage package)
at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver)
at Waasp.PackageInstaller.InstallPackage(String packageId, SemanticVersion version, String projectPath, String targetFolder)
But I have VS 2015 and VS 2017 installed. My Vs 2015 says that I have nuget version 3.5 installed and vs 2017 says that I have nuget v4.2.
What have I tried
I ran nuget in my cmd, but it was not a recognized so I've downloaded the latest version and have added it to my environment, so when I run cmd, go to the folder where I have my uaas.cmd file and type
nuget update -self
It tells me that I have nuget 4.2 and it is up to date. But when I try the uaas.cmd, the same error happens
I don't understand! where does it find 2.8.1.0?! why doesn't it take 4.2?
P.S: I also wrote on Umbraco forum, but I guess it is more related to the nuget client than umbraco

I wrote my question on our Umbraco too and it appeared to be their error :)
In case anyone ended up in the same situation as me:
This is the answer from Sebastiaan:
link to the topic
The problem is that UaaS.cmd does run nuget 2.8.1 in it (it's ILmerged into the waasp.exe it download).
I'm working on getting it updated but the v4 version of nuget.exe is missing some critical methods that we need to create the list of dependencies. So I'm looking into doing some trickery. Anyway, for now, just go into the .Core project and install Newtonsoft.Json and System.Threading.Tasks.Dataflow and then you should be fine!

Related

nuget update -self error

Running nuget update -self from VS 2017 Developer Command Prompt I encountered the following error. How do I make nuget upgrade itself to the latest version?
Checking for updates from https://nuget.org/api/v2/.
Currently running NuGet.exe 2.0.30619.9000.
Updating NuGet.exe to 4.4.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: 'title, tags, summary, licenseUrl, releaseNotes, copyright, description, projectUrl, frameworkAssemblies, language, references, dependencies, iconUrl' in namespace 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd'.
How do I make nuget upgrade itself to the latest version?
You can run the command nuget update -self from VS 2017 Developer Command Prompt without following error:
'nuget' is not recognized as an internal or external command, operable
program or batch file.
That means that you should added a path of nuget.exe to the environment variable before or you have a old nuget.exe under the path C:\Users\bboyl\Source.
If you want to update nuget itself, you could manually download the the newer version form nuget.org, Under the section titled "Windows x86 Commandline", replace the old version in the path on your PC.
BTW, It seems the nuget.exe version 2.0.30619.9000 of the system environment variable path is too low to automatically update. So we have to update it manually, just download the new version of nuget.exe.
For example, I have a nuget.exe with version 4.1.0.2450 under the path D:\NuGet4.0, then I set this path into the environment variable. After that, I could update the nuget.exe itself to 4.4.1 in the VS 2017 Developer Command Prompt:
Now we could also update nuget itself with the command nuget update -self.

Error "end of central directory record signature not found" while installing ionide-fsharp in vscode

I have installed VS Code version 1.8.1. Machine is Windows 7, 64 bit. While installing ionide-fsharp extension, I am getting error "end of central directory record signature not found". It seems version 1.7.2 of VS Code works, however this issue probably seems fixed for version 1.8.0 see this git link. Any idea on how to get the extn installed?
Thanks
Found a workaround for this. Downloaded '.vsix' file of ionide-fs from this link. In VS Code Extensions tab, there is an option 'Install from VSIX'. That worked. So in case anyone is unable to install from vscode extensions tab directly(i.e. from Marketplace), they may try this way of installing an extension.
Just for information, I was getting the same error for version 1.7.2 of vscode as well while trying to install from Marketplace.
Seems there were bugs that exist in past versions, due to the embedded browser and other reasons; these have since been fixed.
The above solution seems a common way to install a troublesome plugin.
However, there is a long standing reason for this error, running out of disk space.
As of v1.54.1 (2021/03) and it turns out this can happen if your disk/home folder can run out of space during download OR install.
https://github.com/microsoft/vscode/issues/118711

Nuget Package Downloads But Isn't Installed On TFS Build

Title pretty much says it all. I have a project which uses some nuget packages. All are downloaded but two of them (HTMLAgilityPack and Newtonsoft) are never installed i.e. the .nupkg file is not extracted, thus, the required .dlls cannot be found and the build fails. Here's the part of the build log file showing when the packages are restored on the build server:
Target "RestorePackages: (TargetId:587)" in file "##\nuget.targets" from
project "##.csproj" (target "ResolveReferences" depends on it):
Task "Exec" skipped, due to false condition;
Task "Exec" (TaskId:360) Task Parameter:Command="##\nuget.exe" install
"##\packages.config"
-source "https://nuget.org/api/v2/" -RequireConsent -solutionDir
"##\Sources\" (TaskId:360) Task
Parameter:LogStandardErrorAsError=True (TaskId:360) "##\nuget.exe" install
"##\packages.config"
-source "https://nuget.org/api/v2/" -RequireConsent -solutionDir
"##\Sources\ " (TaskId:360)
Successfully installed '###.Utilities.Excel 1.0.0.0'. (TaskId:360)
Successfully installed '###.Utilities.FileIO 1.0.0.1'. (TaskId:360)
Successfully installed '###.Utilities.String 1.0.0.0'. (TaskId:360)
All packages listed in packages.config are already installed.
(TaskId:360) Done executing
task "Exec". (TaskId:360) Done building target "RestorePackages" in
project "##.csproj".: (TargetId:587)
As you can see, HTMLAgilityPack and Newtonsoft are not installed as part of the RestorePackages task. Why would TFS build download but not install these packages?
As you wrote, an old nuget.exe will do this.
What I do is take the "..nuget\nuget.exe" out of the equation.
I put nuget.exe on the build server.
I store them like this:
C:\MyProgFiles\NuGet\2.8.6\nuget.exe
C:\MyProgFiles\NuGet\3.3.0\nuget.exe
You might ask why I keep the olders. There are occasionally issues with the newest build.
Then on my builds, I setup the build server, I essentially run this:
"C:\MyProgFiles\NuGet\3.3.0\nuget.exe" restore c:\builds\1\SomeDirectory\MySolution.sln -NoCache
Obviously, you'll use macros instead of hard coded paths.
This will (obviously) restore the packages.
I use "NoCache" because occasionally our private nuget cache has things removed......which are cached on the build server. The nocache arg will find this issue sooner than later.
If anyone else comes across this it could be that the nuget.exe you're using to restore the packages is outdated. In my case the project I was working on was started by someone else 2 years ago, I added a relatively new nuget package and the old nuget.exe wasn't compatible with it. You can download the latest version of the nuget.exe here
.

How to use paket from command line

I installed paket from nuget in Nuget Package Manager Console with:
Install-Package paket
I then tried to run paket convert-from-nuget. It stalled out on a user prompt (it wouldn't let me type into the package manager console). My next thought was to run it from command line, but how to do so is not documented.
Just putting paket convert-from-nuget into a standard dev command prompt results in an error saying "paket" is not recognized.
How do I run paket from the command line or powershell, and how do you specify which solution to work against?
The way to setup paket in your repository is as follow:
1 Download a release of paket.bootstrapper.exe
This is a lightweight utility which obtains and updates paket.exe, pick stable release from official release page:
https://github.com/fsprojects/Paket/releases
2 create a .paket folder
md .paket
3 put the downloaded bootstrapper in this folder and invoke it
cd .paket
paket.bootstrapper
now you have an up-to-date paket.exe ready to ease your handling of dependencies.
4 convert from nuget
cd ..
.paket\paket convert-from-nuget
Please checkout the https://github.com/fsprojects/Paket.VisualStudio also for Visual Studio plugin to help you authoring paket.dependencies and paket.references file
Please also join https://gitter.im/fsprojects/Paket if you have any questions.
The Chocolatey package modifies the PSModulePath envivornment variable. I've observed that sometimes that modification isn't picked up until the system is restarted (or at least not until the user logs out and back in again). In the meantime, you can import the module using:
Import-Module <path-to-packages>\Paket.PowerShell\Paket.PowerShell.psd1
The packages path is usually something like C:\Chocolatey\lib. OTOH, re-reading your question, are you referring to the Nuget inside of Visual Studio? If so, that downloads from NuGet.org and that pkg puts paket.exe in $(SolutionDir)\packages\Pakget.1.18.5\tools\paket.exe. Your version number may varying.
Unfortunately the fact that PowerShell V5 introduces Install-Package (which downloads from Chocolatey by default) is going to get a little confusing vis-a-vie the NuGet Package Manager Console's Install-Package in Visual Studio.

NuGet in Package Manager Console installs old version of package by default

We have an internal NuGet repository for Our class Libraries. I've created a package MyPackage Version 1.0.0.0 which had a bug, so I pushed a New Version (or revision) of the package, 1.0.0.1.
Now, when I create a New Project and use the Manage NuGet Packages dialog, I get the latest Version (1.0.0.1) when I install the package. However, when I use the Package Manager Console for another New Project and type Install-Package MyPackage, I get Version 1.0.0.0 by default.
Why does this happen? I can't find anything in the NuGet documentation explaining why this happens, so it seems to be a bug in NuGet.exe.
Try running the Update-Package command.
The package is probably "cached" locally, and when you use the "Install", it only gets the cached version.
You can also verify this by going to:
(windows)
C:\Users\~MyUserName~\AppData\Local\NuGet\Cache\
OR (linux)
/Users/MyUserName/.nuget/packages/
(Replace ~MyUserName~ of course)
and deleting the package from there...then "Install".
(The idea being, if its not in the cache, it'll go back to the server to get it)
For information if anyone runs across this issue, it was a bug in 2.7 that has been fixed as of 2.8. Details at: https://nuget.codeplex.com/workitem/3684
Upgrading your client to 2.8 will fix the issue.