开发者

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

开发者 https://www.devze.com 2023-01-05 22:27 出处:网络
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 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开发者_C百科 not sure if I should use it here or find another way.

What do you think?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消