找不到Stripe.net的命名空间

找不到Stripe.net的命名空间

问题描述:

我正在尝试安装Stripe.net的较新版本:
https://github.com/jaymedavis/stripe.net

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

  • 通过Nuget,我构建了Stripe.dll文件
  • 我创建一个新的网站项目
  • 我添加了对Stripe.dll的引用
  • 我添加了对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]");   
    }
}

但是它引发了错误:

错误1名称'StripeConfiguration'在当前上下文中不存在

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

我尝试了其他示例,但是都抛出了类似的错误.

I try other examples, but all throw similar errors.

可能有许多原因,例如,下载导致的构建无效或构建您自己的一些错误.这就是为什么我主要使用 Nuget软件包管理器的原因.

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.

使用以下步骤:

在Visual Studio (2012)中:

In Visual Studio (2012):

  1. 转到工具-> Nuget软件包管理器->管理Nuget数据包 解决方案...
  2. 搜索"Stripe.Net",安装它.
  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.

这样,您可以最大程度地减少手动生成dll期间可能出现的错误.

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