Geeks With Blogs

News




ThreadAbortException my experiments with //Web

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 !!!

Posted on Tuesday, December 15, 2009 11:51 PM | Back to top


Comments on this post: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
It was really helpful. Thanks!
Left by Giri on Dec 20, 2009 7:08 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks. I had the same problem. Figured out few of the changes myself, but your article provided better help.
Left by Gopinath Sundharam on Dec 25, 2009 10:39 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks,that was useful. I still have problems with the metadata :s I wasn't able to build any project on codeplex :s can I anyone help plzzzz??
Left by Mohammad on Jan 07, 2010 7:56 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
That's really informative ranga. I was really bothered about it, when i got this error. thanks for finding time in explaining it.
Left by nithin mohan on Jan 08, 2010 12:36 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks so much!

This kind of stuff really frustrates me... SDK that contains code that doesn't work... not the first time for sure!
Left by Fabtastic on Jan 21, 2010 8:53 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks for that I've been having that error for a while with the new upgrade in place. I love the fact that searching google leads me straight to the answers I am looking for.
Left by saddles for sale on Feb 06, 2010 5:17 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
This is indeed a great post! I want to share this to my friends
Left by Writer Jobs on Feb 17, 2010 12:32 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks. This post was very helpful. Right we are developing a project o windows azure, starting from an open source application on the ctp. I finaly made it run ok on the final release of Azure
Left by Tudor on Feb 22, 2010 2:00 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks man! All the Books and Samples use the old notion. U rescued my day!

Left by ture on Mar 10, 2010 5:09 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
It really helps me! thanks a lot
Left by Fatal Error Solver on Mar 12, 2010 3:37 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Way better than actual Microsoft support! Maybe Bill Gates should be paying YOU!
Left by Saddles For Sale on Mar 13, 2010 1:41 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Nive Training Kit
Left by Sarasota Welding on Mar 14, 2010 2:52 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Excellent Training info
Left by Cathy on Mar 14, 2010 2:55 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
you're one great programmer of the century. kudos
Left by Pass Nclex on Mar 17, 2010 1:01 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
How to migrate web applications to Windows Azure?
Left by whitening teeth at home on Mar 22, 2010 5:31 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
I had the same problem, can you please provide more info on this.
Left by conceive baby girl on Mar 22, 2010 5:34 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
You always have great info. Thanks!
Left by sell gold for cash on Apr 05, 2010 5:05 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
This is what I have been looking for. You save me time baby.
Left by penis extenders on Apr 07, 2010 10:15 PM

# # re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
These changes should make your StorageClient project build successfully :)
Left by Infrapunasauna on May 02, 2010 4:05 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks for the tip, I will prove to see how it's works, thanks!
Left by negocios marketing on May 17, 2010 8:01 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks for the article. Much appreciated
Left by BlueHost Review on Jul 13, 2010 5:40 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
glad to find this article, save me tons of time. Thanks man
Left by Vincent on Sep 03, 2010 1:26 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me
Left by Advertising Resume on Nov 28, 2010 4:58 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Perfect! Its only few days I have made plans shifting to azures and after surfing for 1 and a half hour on the internet, I have finally found a place where I can get the most relevant information about my subject. I must bookmark this page for sure and thanks a ton to the author of this post.
Left by Circle Y Saddles on Mar 09, 2011 11:31 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks for the information. the good thing about this blog is that I can always come back to it with my technical problems
Left by Casas en Miami on May 28, 2011 5:08 AM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks. Post was really helpful and informative.
Left by Trupti Sarang on Jun 01, 2011 7:02 PM

# re: FIX for Unable to find “Microsoft.ServiceHosting.ServiceRuntime” Windows Azure Training Kit Nov 09
Requesting Gravatar...
Thanks for this article. It was very helpful to me.
Left by Bardhyl on Apr 05, 2014 5:38 PM

Your comment:
 (will show your gravatar)


Copyright © Harish Ranganathan | Powered by: GeeksWithBlogs.net