Windows Azure SDK 1.6 update

Today I updated Windows Azure SDK to the latest 1.6 from November 2011. The update was from SDK 1.4 which I uninstalled before installing 1.6. After the update my unittests failed. Short solution below.

  1. Commandline to set environment variable:
    setx WindowsAzureEmulatorInstallPath "c:\program files\windows azure emulator\emulator"
  2. Regedit to change value:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure Emulator] 
    "InstallPath"="C:\\Program Files\\Windows Azure Emulator\\emulator"

For those who enjoy more information keep reading.

The first error I got running the unittests after the upgrade was

Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabricException: Unable to find filedevstore\DSService.exe please verify your install is correct.

I thought this was me not running DSInit like described in so many posts. So I did. And it was certainly needed, but not the core problem. The execption was stil the same.

The release notes, that eveybody reads before installation, reports the location change of the Windows Azure Emulator. Changed locations and “Unable to find file” in the exception adds up. Now what can I do about it?

I love Reflector and have used it in many of my posts. In the code of Microsoft.ServiceHosting.Tools there is an Environment variable called WindowsAzureEmulatorInstallPath that should point to the emulator directory as a fallback. I’ve set this up by hand, but here is a commandline you can use:

setx WindowsAzureEmulatorInstallPath "c:\program files\windows azure emulator\emulator"

Now everything worked whenever the Storage Emulator was already started, but that wasn’t enough. The exception when the emulator was not running was

The type initializer for ‘Microsoft.ServiceHosting.DevelopmentStorage.Utilities.DevelopmentStorageConfigCache’ threw an exception. —> System.NullReferenceException: Object reference not set to an instance of an object.

Again using Reflector I found the use of a registry key for resolving the installation path of the Windows Azure Emulator (not very consistent Microsoft :|). Registry key was HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure Emulator\InstallPath. The registry key already existed, but the value was without the emulator subdirectory. After changing the value to c:\program files\windows azure emulator\emulator everything worked again, even starts the emulator when it is not running.

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.