找不到Stripe.net的命名空间 [英] Namespace not found for Stripe.net

查看:79
本文介绍了找不到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.

这篇关于找不到Stripe.net的命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆