braintree_aspnet_example
braintree_aspnet_example copied to clipboard
Had to Update `ConfigurationManager` to `WebConfigurationManager`
General information
- Environment: Sandbox
- Language, language version, and OS: Microsoft.AspNet.Mvc v5.2.3, Visual Studio Community Edition 2017
Issue description
I'm piggy backing on the sample here to develop a plugin for Umbraco.
Really simple issue that I wanted to run by you - but the ConfigurationManager
must have been changed recently? To get the sample/ code running I had to make some adjustments to BraintreeConfiguration.cs
. Did anyone else need to do this to get it running?
- Update
using using System.Configuration;
tousing using System.Web.Configuration;
- Update
return ConfigurationManager.AppSettings[setting];
toreturn WebConfigurationManager.AppSettings[setting];
fhujk
Sorry it took so long to get to this.
It looks like this repo has MVC version 4.0.30506.0 https://github.com/braintree/braintree_aspnet_example/blob/39f4a69bb6f3fe028252f6dc9d6897e8bdfe23f5/BraintreeASPExample/packages.config#L4
If you switch from v5 to v4, does it work?
@crookedneighbor There is no such thing as ConfigurationManager anymore in ASP.Net Core. This article explains it pretty well: https://www.danylkoweb.com/Blog/no-configurationmanager-in-aspnet-core-GC
We should probably update this example repo to use .NET core since that's the latest version now. We will do that eventually, but if anyone wants to submit a PR in the meantime, I'm happy to review it.
Any update on this?
This is not a high priority for my team right now. We encourage anyone that wants to get involved to open a PR.
for internal tracking, ticket 1882