There are many situations that developer needs to known what are the content or web roots paths. One of such situations is accessing custom JSON configuration files. In the classics ASP.NET applications you was always able to use method. With that method you was able to find physical path or web root directory. Later on in RC1 there was possibility to use service.
That’s not possible in ASP.NET Core. Those paths (web root and content root) are accessible in service which can be simply injected in almost any place of code. Here is an example usage of that service: