Recently I came across this strange issue while trying to upgrade the Windows Azure Cache version using NuGet. In NuGet only the latest version is visible by browsing and for any of the previous versions the power shell integrated with Visual Studio needs to be used.
So we used the following
Visual Studio > Tool > Package Manger console
PM> Install-Package Microsoft.WindowsAzure.Caching -Version 18.104.22.168
Installing 'Microsoft.WindowsAzure.Caching 22.214.171.124'.
You are downloading Microsoft.WindowsAzure.Caching from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkID=235167.
Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.WindowsAzure.Caching 126.96.36.199'.
Adding 'Microsoft.WindowsAzure.Caching 188.8.131.52' to CloudWorkerRole.
'Microsoft.WindowsAzure.Caching\PerformenceCounters.xml' already exists.
'Microsoft.WindowsAzure.Caching\ClientPerfCounterslnstaller.exe.config' already exists, skipping...
'Microsoft.WindowsAzure.CachingClientPerfCountersInstaller.exe' already exists.
Uninstalling 'Microsoft.WindowsAzure.Caching 184.108.40.206'.
Successfully uninstalled 'Microsoft.WindowsAzure.Caching 220.127.116.11'.
Install failed. Rolling back…
Install-Package : The method or operation is not implemented
At line:1 char: 1
+ Install-Package Microsoft.WindowsAzure.Caching -Version 18.104.22.168
+ CategoryInfo : NotSpecified: (:) [Install-Package],
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,
It starts installing and halfway starts rolling back. With Time Travel Tracing (also known as iDNA tracing) we found the following. iDNA by itself is a vast topic and I will not cover it here but you can search for lot of material available in the internet. The part below is esoteric and I took the help of my senior Mike Wong (Senior EE) to unravel the mystery.
NuGet is calling
If we look at the implementation of IsItemUnderScc in the Serena.VsCMPkg.dll we see the following
.method public hidebysig newslot virtual final
instance bool IsItemUnderSCC([in] string ItemName) cil managed
// Code size 6 (0x6)
IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor()
} // end of method SerenaVsCMPkg::IsItemUnderSCC
So this is causing the issue of the Nuget package installation to rollback. The original message in package manager is
Install-Package : The method or operation is not implemented.
We unbounded Visual Studio from Source Control.
Visual Studio > Tools > Options > Source Control > Plug-in Selection, change Current source control plug-in to “None”.
We are preventing NuGet from calling into the source control. Once we have disconnected the source control the NuGet and ran the installation command from the Visual Studio Package Manager it installed fine. So the crux of it is if you are in a situation where the Windows Azure Cache NuGet package is rolling back check if it is under source control. Detach from source control and try to install the package again.