braintree_aspnet_example icon indicating copy to clipboard operation
braintree_aspnet_example copied to clipboard

Had to Update `ConfigurationManager` to `WebConfigurationManager`

Open markadrake opened this issue 7 years ago • 7 comments

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; to using using System.Web.Configuration;
  • Update return ConfigurationManager.AppSettings[setting]; to return WebConfigurationManager.AppSettings[setting];

markadrake avatar May 16 '17 20:05 markadrake

fhujk

hrheh avatar Jun 21 '17 13:06 hrheh

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 avatar Sep 21 '17 21:09 crookedneighbor

@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

paulbanwart avatar Dec 10 '17 00:12 paulbanwart

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.

crookedneighbor avatar Dec 18 '17 20:12 crookedneighbor

Any update on this?

smendoza88 avatar May 11 '20 19:05 smendoza88

This is not a high priority for my team right now. We encourage anyone that wants to get involved to open a PR.

crookedneighbor avatar Jul 22 '20 15:07 crookedneighbor

for internal tracking, ticket 1882

hollabaq86 avatar Sep 07 '22 15:09 hollabaq86