Namespace not found for Stripe.net

最后都变了- 提交于 2019-12-14 02:34:19

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/26489143/namespace-not-found-for-stripe-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!