How do I know the the complete virtual path that my application is currently hosted? For example:
http://www.mysite.com/myApp
or
The below code will solve the purpose, however you have to do a bit tuning for two types of scenarios:
Hosted as Virtual application within a web application.
HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpRuntime.AppDomainAppVirtualPath;