You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to have WebHostEnvironment during configure services, but i don't figure out how to do it.
if i do it in this "tricky way" i think the order of execution is preventing me from having WebHostEnvironment anyway.
i get a null reference exception, i guess because the middleware (IApplicationBuilder>> steps) are configured before the services (IServiceCollection>> steps)
Any working way in which i could get WebHostEnvironment in the service step ?
typeApplicationBuilderwith[<CustomOperationAttribute("acme_bootstrap")>]memberthis.AcmeBootstrap(state :ApplicationState)=let mutableenvironment:IWebHostEnvironment =nullletmiddleware(app :IApplicationBuilder)=
environment <- Environment.getWebHostEnvironment(app)
app
letservice(services :IServiceCollection)=
services.BootstrapEndpointsWebApplication(
environment,/// breakes here with NULL REF EX as this is invoked before middleware setup i guess...(Config.getConfiguration(services)),fun opt ->
opt.ApplicationInformation.ApplicationName <-"Travix.WebApi.Template.ApplicationName"
opt.ApplicationInformation.ApplicationGroup <-"Travix.WebApi.Template.ApplicationGroup"){ state with
ServicesConfig = service::state.ServicesConfig
AppConfigs = middleware::state.AppConfigs
}
The text was updated successfully, but these errors were encountered:
I am trying to have WebHostEnvironment during configure services, but i don't figure out how to do it.
if i do it in this "tricky way" i think the order of execution is preventing me from having WebHostEnvironment anyway.
i get a null reference exception, i guess because the middleware (IApplicationBuilder>> steps) are configured before the services (IServiceCollection>> steps)
Any working way in which i could get WebHostEnvironment in the service step ?
The text was updated successfully, but these errors were encountered: