Ok, I am playing with the Windows Azure Training Kit November 2009 release and the first sample I wanted to try was “Migrating web applications to Windows Azure”. I believe a whole bunch of people moving to Azure aren’t just going to create new web apps but rather try and move their existing web apps which is why, I thought this exercise is more important.
After following the initial few steps, I came to the place where we manage state providers and one of the requirement is to the StorageClient library available as a part of the training kit. Now when you add reference to this library (project) and try to build, you may hit the above error i.e. unable to find “Microsoft” or “Microsoft.ServiceHosting.ServiceRuntime” which is one of the primary assemblies used in the “StorageAccountInfo.cs” file.
I went through various searches and found out the information that this has moved to Microsoft.WindowsAzure.ServiceRuntime. What followed was a series of build errors in the same file pointing to various references. So the idea behind this post is to help folks get through this hurdle.
First off, you heard it already, you need to remove the reference for “Microsoft.ServiceHosting.ServiceRuntime” from both the project references as well as the “using….” statement in the class file. It needs to be replaced with “Microsoft.WindowsAzure.ServiceRuntime” both in add reference as well as the using area of the class file.
Secondly, you will get the error “RoleManager” does not exist. This should be replaced with “RoleEnvironment”
Then you would hit the error at “IsRoleManagerRunning” that needs to be replaced with IsAvailable, i.e. RoleEnvironment.IsAvailable
Then, you would also get error at RoleEnvironment.GetConfigurationSetting. It needs to be replaced with RoleEnvironment.GetConfigurationSettingValue
Finally, you would also get error at catch(RoleException). That needs to be replaced with catch(RoleEnvironmentException)
These changes should make your StorageClient project build successfully :)
You will get the above errors in the “AspProviders” project file as well and would need to replace them.
Another error that you would hit is around the RoleManager.WriteToLog which is replaced with the Microsoft.WindowsAzure.Diagnostics for logging events. You can read more about it at http://msdn.microsoft.com/en-us/library/ee830425.aspx
However, in my case, I commented that particular line and went ahead with the SDK sample.
Would keep posted of more explorations as and when I hit :)
Cheers !!!