My ASP.NET web app is deployed into a location like https://server/path1/path2
.
How can I get in the C# code that path, where the app is running?
My ASP.NET web app is deployed into a location like https://server/path1/path2
.
How can I get in the C# code that path, where the app is running?
This should work:
string baseURL2 =
Request.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.UriEscaped);
Debug.Print(baseURL2);
It does not include a trailing "/"
Edit: sorry, I see this is for MVC, so, I can't suggest if above will work. Above was for webforms.