Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Create IHostingEnvironment and implementation #71

Closed
glennc opened this issue Sep 10, 2014 · 4 comments
Closed

Create IHostingEnvironment and implementation #71

glennc opened this issue Sep 10, 2014 · 4 comments

Comments

@glennc
Copy link
Member

glennc commented Sep 10, 2014

using System;

namespace Microsoft.AspNet.Hosting
{
    [AssemblyNeutral]
    public interface IHostingEnvironment 
    {
        string EnvironmentName { get; }
        string WebRoot { get; }
    }
}

This interface is the moral equivalent of the IApplicationEnvironment but for web applications. The environment name is the name of the currently running environment and the WebRoot is where the web sever is rooted.

@glennc glennc added this to the 1.0.0-beta1 milestone Sep 10, 2014
@glennc glennc modified the milestones: 1.0.0-alpha4, 1.0.0-beta1 Sep 10, 2014
@glennc glennc assigned Tratcher and unassigned lodejard Sep 10, 2014
@glennc
Copy link
Member Author

glennc commented Sep 10, 2014

@Tratcher Can you talk to @loudej about this before implementing, before Friday.

@Tratcher
Copy link
Member

This includes #64, no?

@Tratcher
Copy link
Member

See aspnet/dnx#613

@Tratcher
Copy link
Member

Add a reference to Json.Net. Use the IApplicationEnvironment to find the project.json file and read it. Find the webroot element. Add IHostingEnvironment to the services.

For PhysicalFileSystem, retrieve IHostingEnvironment from the services and get the webroot. Fall back to IApplicationEnvironment.ApplicationBasePath like we do today. Consider moving this logic to the caller of PhysicalFileSystem (e.g. StaticFiles)

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

No branches or pull requests

4 participants