Reputation: 36
I need to get current iis website (started website) name in configureservice method in statup class in aspcore2. I need it in sub class of configureservice I try HttpContextAccessor but it always is null
Upvotes: 1
Views: 990
Reputation: 42
You could use the following code in the startup class:
public Startup(IConfiguration configuration)
{
Configuration = configuration;
var name = Configuration["ASPNETCORE_APPL_PATH"];
}
Upvotes: 0