F# 从IHostingEnvironment迁移到IWebHostEnvironment
我有这个:F# 从IHostingEnvironment迁移到IWebHostEnvironment,f#,f#-giraffe,F#,F# Giraffe,我有这个: let configureApp (app : IApplicationBuilder) = let env = app.ApplicationServices.GetService<IHostingEnvironment>() (match env.IsDevelopment() with | true -> app.UseDeveloperExceptionPage() | false -> app.UseGiraffeE
let configureApp (app : IApplicationBuilder) =
let env = app.ApplicationServices.GetService<IHostingEnvironment>()
(match env.IsDevelopment() with
| true -> app.UseDeveloperExceptionPage()
| false -> app.UseGiraffeErrorHandler errorHandler)
let-configureApp(应用程序:IApplicationBuilder)=
让env=app.ApplicationServices.GetService()
(将环境IsDevelopment()与
|true->app.UseDeveloperExceptionPage()
|false->app.UseGiraffeErrorHandler(错误处理程序)
当我尝试迁移时,我得到一个错误:
let configureApp (app : IApplicationBuilder) =
let env = app.ApplicationServices.GetService<IWebHostEnvironment>()
(match env. with
let-configureApp(应用程序:IApplicationBuilder)=
让env=app.ApplicationServices.GetService()
(将环境与
我不知道在此代码段中应该更改什么。基于,您需要确保已打开名称空间Microsoft.AspNetCore.Hosting