c# - 未找到 Stripe.net 的命名空间

标签 c# namespaces nuget stripe.net

我正在尝试安装较新版本的 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]");   
    }
}

但它抛出错误:

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

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

最佳答案

原因可能有很多,例如,下载的构建无效,或者您自己构建时出现错误。这就是为什么我主要使用 Nuget Package Manager

使用以下步骤:

在 Visual Studio 中(2012):

  1. 转到“工具”->“Nuget 包管理器”->“管理 Nuget 数据包” 解决方案...
  2. 搜索“Stripe.Net”,安装它。

它将添加所有必需的引用。

这样您就可以最大程度地减少手动构建 dll 期间可能发生的错误。

关于c# - 未找到 Stripe.net 的命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26489143/

相关文章:

c# - LINQ 排序匿名类型?

xml - 省略额外的 xlmns 和 xmlns :tei that appear when I apply my transformation

powershell - Nuget Powershell命令-查找安装了特定软件包的项目

C# WPF Combobox 下拉列表到多列

c# - IQueryable 的结构是什么?

c# - 如何实现具有容差的 IEqualityComparer<PointF>

xml - XSLT 如何在模板内的元素中添加命名空间前缀

c++ - C++ 重载解析规则中的缺陷?

c# - 在容器 dotnet 核心容器中运行时无法加载文件或程序集 'Newtonsoft.Json,版本 = 12.0.0.0

c# - nuget 包 dll 或源文件