views:

28

answers:

1

I am trying to get the base URL from the worker role. I can't get it from there.

How do I get the base URL in this situation?

I have found this property:

Application.Current.Host.Source

but, in order for this to work, I need the reference System.Windows.dll which is in the Silverlight folder. Since I am not using Silverlight for this part of the application I am not sure if I should use it here or find another way.

What do you think?

+1  A: 

Are you trying to find the external URL of your app? (Like something.cloudapp.net?) If so, there isn't a good way to do this from within a Windows Azure application (without calling out to the Service Management API and looking up the deployment by ID).

smarx
OK smarx, but how do we call out the service management API? If you can leave here a link about it I appreciate. Thumbs up. Thanks.
Fabio Milheiro
Start here: http://msdn.microsoft.com/en-us/library/ee460799.aspx, but be sure to check out csmanage.exe (and corresponding .NET library) here: http://code.msdn.microsoft.com/windowsazuresamples.Note that it may be simpler to just put the domain name in a config setting if that's an option for you.
smarx
I forgot to check your answer as accepted. Thanks!
Fabio Milheiro