The following is Giving me error as Configuration Var builder = WebApplication.CreateBuilder(args) How do we get these objects, to say read the configuration from appsettngs? Currently the Program.cs file looks like this. So how do we get these objects like Configuration(IConfiguration) and Hosting Environment(IHostEnvironment) NET 6 (With Visual Studio 2022), we don't see the Startup.cs class. Public void Configure(IApplicationBuilder app, IWebHostEnvironment env) Public void ConfigureServices(IServiceCollection services) Public Startup(IConfiguration configuration, IHostEnvironment environment) Private readonly IHostEnvironment environment In earlier versions, we had Startup.cs class and we get configuration object as follows in the startup file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |