最佳答案
我需要检查在 ConfigureServices方法是否当前托管环境名称是“开发”。
因此,使用 IHostingEnvironment.IsDevelopment()方法对我来说可能是可以的,但是与 Configure 方法不同的是,我没有 IHostingEnvironment env。