How to Force Downgrade Azure Emulator Back to Previous Version
- Posted in:
At work, we are still doing Cloud Service for our Azure solution which requires the Compute Emulator.
I was helping my co-worker to test his upgrade to Azure SDK 2.9 so we could move on to Visual Studio 2015. At the time, our solution was running on Azure SDK 2.6 and so I installed Azure SDK 2.9 for Visual Studio 2015 and ran the upgraded version of our solution on my machine. It ran just fine but since we wanted to make sure that this is properly tested, we didn't want to commit to using Azure SDK 2.9 yet. Until such point in time, we actually wanted the main development to still use Azure SDK 2.6. This itself is fine since we specifically created an Azure SDK 2.9 Upgrade branch so the affected source code is isolated to that specific branch and the rest are still on 2.6 SDK. This is all well and good until...
When I tried to go back to my own feature branch that is still on Azure SDK 2.6 and started the debugging session, the Azure Compute Emulator did not work any longer. It kept throwing the following "Error: The installed Microsoft Azure Compute Emulator does not support the role binaries." and suggested that I upgrade my solution to Azure SDK 2.9 which I certainly do not want to do until our test is completed and passing.
I am now in a bind. I can't run and debug my own feature branch due to this problem. Apparently the emulator does not support side-by-side installation and itself has been upgraded to version 2.9 and Emulator 2.9 just don't like 2.6 projects. Sigh.
After looking around the web for the answer and finding none, I got to thinking that there are about 2 options that I could do to fix this...
Option 1. Use System Restore to go back to a previous state when the SDK 2.9 bits are not yet installed... Unfortunately, the installation didn't create a System Restore point and I didn't do it manually either... so there goes that option.
Option 2. Somehow reinstall Azure Compute Emulator 2.6 and force it to overwrite the current 2.9 Emulator. This seems to be my only option now...
So, from previously spelunking attempts, I know the Azure SDK bits is located in "%PROGRAMFILES%\Microsoft SDKs\Azure\Emulator". If my hunch is correct, the bits should be installed here. So, what if I try downloading the 2.6 Compute Emulator installation bit from https://azure.microsoft.com/en-us/downloads/archive-net-downloads? Clicking the Azure SDK for .NET version under April 2015 (version 2.6) link which took me to: https://go.microsoft.com/fwlink/?linkid=534218&clcid=0x409. Clicking the big red Download button showed me a bunch of bits which include the MicrosoftAzureComputeEmulator-x64.exe which is exactly what I needed. After downloading the program, I tried running it and got stopped in the middle of installation since a newer version of the emulator is already installed... So, now what do I do?
Well, I tried running that exe using /? options and lo and behold, there is an /uninstall parameter that I can use to uninstall... So, what if I download the 2.9 Compute Emulator installation program and run it with that parameter from Command Prompt... and... Voilà!! All the bits now got removed from inside the "%PROGRAMFILES%\Microsoft SDKs\Azure\Emulator" directory. Great... so now I tried reinstalling the 2.6 Computer Emulator bit using the 2.6 installation bit... and... it got installed just fine.
The final step was to try running my 2.6 solution back from Visual Studio and... YAY, it ran just fine. Problem solved.
I hope this is useful for other people that also run into this issue. Like I mentioned, I couldn't find anywhere on the web that explains this.