I am using Microsoft.Extensions.Configuration and would like to change from Json to Yaml do to an sdk change. I have tried just changing .json to .yml and that did not work. I also tried to change AddJsonFile to AddYamlFile both did not work and I commented out the different attempts below.
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AppiumTestingofmobileapps.Utility
{
public static class ConfigurationBuilder
{
public static IConfiguration InitConfig()
{
//var config = new
ConfigurationBuilder().AddJsonFile("appsettings.test.json").Build();
//var config = new ConfigurationBuilder().AddJsonFile("browserstack.yml").Build();
//var config = new ConfigurationBuilder().AddYamlFile("browserstack.yml").Build();
return config;
From what I saw there no default addYamlFile extension method in
Microsoft.Extensions.Configuration.ConfigurationBuilderConfigurationBuilder Class for yaml but I saw that there is aMicrosoft.Extensions.Configuration.Yamlthat you can Install from nuget.