Jisha
Jisha

Reputation: 51

using appsetting.Development.json for AWS Mock Lambda Test Tool

Is there any support for appsetting.Development.json with AWS Mock Lambda Test Tool. Can I use appsetting.Development.json to load the application related setting while debugging lambdas locally. My lambdas are inside dot net core library project.

netcoreapp2.1

Upvotes: 1

Views: 1479

Answers (1)

Jisha
Jisha

Reputation: 51

This can work even for dot net core class libraries.

new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", optional: true)
                .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("Environment")}.json", optional: true)
                .AddEnvironmentVariables()
                .Build(); 

Upvotes: 4

Related Questions