I have a project as follows:

ProjectRoot folder

* Web API Project
* Console App Project
* Shared Class Library

I am attempting to fetch from my appsettings.json folder inside of my Console App project using Directory.GetCurrentDirectory(), however when running a debug session this is returning the ProjectRoot folder, rather than the Console App folder.

Does anyone know why this is? Or the correct way to fetch the appsettings from my console app folder?

My function looks like this:

```
private static IConfigurationRoot GetConfiguration(){
        return new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("appsettings.json", optional: false)
        .Build();
    }

```

//EDIT:

Question 2) It is also worth noting, my web API project gets the IHostingEnvironment variable via dependency injection, and I am able to use env.ContentRootPath successfully (which returns the path to the web API folder, rather than the parent folder). How can I use ContentRootPath in my console app?