gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 16:54:46 25 4
gpt4 key购买 nike

我正在尝试安装更新版本的 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) 中:

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

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

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

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

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com