In my AppSettings file I have the following block that I want to override with Development and Production app settings files. Whenever I create the serviceContext for Quickbooks online the base url will be set to the default value, which is the quickbooks production url. If I replace the empty string in the app settings file it will use that string as the url. For some reason only the string in the app settings file is used to create the service context and not any overriding value that I put in appsettings.development. I would like to be able to override this value depending on the environment. My other environment values are being set properly.
Creating ServiceContext:
OAuth2RequestValidator reqValidator = new OAuth2RequestValidator(token.AccessToken);
ServiceContext serviceContext = new ServiceContext(token.RealmId, IntuitServicesType.QBO, reqValidator);
Appsettings:
"Service": {
"BaseUrl": {
"Qbo": "",
"Ips": "",
"OAuthAccessTokenUrl": "",
"UserNameAuthentication": ""
},
"MinorVersion": {
"Qbo": "37"
}
}
Appsettings.development:
"Service": {
"BaseUrl": {
"Qbo": "https://sandbox-quickbooks.api.intuit.com/",
"Ips": "",
"OAuthAccessTokenUrl": "",
"UserNameAuthentication": ""
},
"MinorVersion": {
"Qbo": "37"
}
}