2

I'm trying to install a newer version of Stripe.net:
https://github.com/jaymedavis/stripe.net

  • Via Nuget, I build the Stripe.dll file
  • I create a new website project
  • I add a reference to Stripe.dll
  • I add a reference to RestSharp.dll

using System;
using Stripe;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        StripeConfiguration.SetApiKey("[your api key here]");   
    }
}

But it throws the error:

Error 1 The name 'StripeConfiguration' does not exist in the current context

I try other examples, but all throw similar errors.

Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
  • 2
    Just tried on a sample Console App, Went to Tools -> Nuget Package Manager -> Manage Nuget Packet for solutions...-> Searched for "Stripe.Net", installed it. It added all the references and I was able to use your code without any error. – Habib Oct 21 '14 at 14:30
  • Like @Habib said this should work. Try to clean solution/rebiuld solution. – mybirthname Oct 21 '14 at 14:35
  • @Habib, thank you this works via that method. Downloading from Github and running the install via nuget myself doesn't work. Any idea why? – Tom Gullen Oct 21 '14 at 14:43
  • 1
    @TomGullen, there could be many reasons, for example, invalid build from download, or some mistake in building yourself. That is why I mostly use Nuget Package Manager – Habib Oct 21 '14 at 14:45
  • 1
    @Habib thanks for the tip, works great. I'll accept your answer if you post it! – Tom Gullen Oct 21 '14 at 14:56

1 Answers1

3

There could be many reasons, for example, invalid build from download, or some mistake in building yourself. That is why I mostly use Nuget Package Manager.

Use the following steps:

In Visual Studio (2012):

  1. Go to Tools -> Nuget Package Manager -> Manage Nuget Packet for solutions...
  2. Searched for "Stripe.Net", Install it.

It will add all the required references.

This way you will minimize the errors which may occur during manually building the dll.

Habib
  • 219,104
  • 29
  • 407
  • 436