Fabio Milheiro
Fabio Milheiro

Reputation: 8474

ASP.Net How do I get the base URL without HttpRequest?

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?

Upvotes: 0

Views: 930

Answers (1)

user94559
user94559

Reputation: 60153

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).

Upvotes: 1

Related Questions