Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Are there any equivalents to Request.Url.AbsolutePath and Request.Url.AbsoluteUri ? #308

Closed
rajajhansi opened this issue May 17, 2015 · 4 comments
Labels

Comments

@rajajhansi
Copy link

No description provided.

@Tratcher
Copy link
Member

We found that AbsoluteUri was not usually the correct value or format for what people needed. Most of the time you need just some parts of the Uri.

From your prior post: I'm porting an ASP.NET MVC5 application into MVC6 and it uses VirtualPathUtility to get the absolute path for paths starting with "~".

@pranavkm, How did you decide to handle "~" in MVC?

@pranavkm
Copy link
Contributor

At this point, we simply trim the ~ and interpret it as ApplicationBasePath.

@rajajhansi
Copy link
Author

@Tratcher @pranavkm , thanks guys. I'm currently injecting IApplicationEnvironment using [Activate] to access the ApplicationBasePath. :) This is ugly. In some places, I construct the IOptions and add properties for anything that depends on IApplicationEnvironment, Configuration etc. Is this the correct way?

@davidfowl
Copy link
Member

@rajajhansi What are you actually doing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants