【问题标题】:Importing namespaces isn't working for an API I just installed导入命名空间不适用于我刚刚安装的 API
【发布时间】:2009-06-12 23:56:46
【问题描述】:

我刚刚获得了 Google Data API,但我似乎无法在我的应用程序中使用它。我得到了 msi 文件,成功构建了 Google Data API SDK。

然后我回到我的项目,右键单击 Bin 文件夹并选择添加引用... 从那里我添加了 C:\Program Files\Google\Google Data API SDK\Redist 文件夹中的所有 dll。

当我输入时,现在在我的项目中:

using Google.GData.Extensions;
using Google.GData.Contacts;
using Google.Contacts;
using Google.GData.Client;

Google 的所有内容都带有红色下划线,当我将鼠标悬停在它上面时,它显示名称空间“Google”找不到。

对我做错了什么有任何想法吗?

【问题讨论】:

    标签: c# asp.net api dll


    【解决方案1】:

    您需要在项目中引用这些程序集。

    转到 Solution Explorer > 右键单击​​ References > 选择 Add Reference...

    在出现的对话框中选择 Browse 选项卡并选择您的程序集。

    【讨论】:

    • 没用...我把它们都引用了,它把它们都导入了 bin...虽然仍然似乎无法识别命名空间
    【解决方案2】:

    使用 ildasm.exe(或更好的)反射器来验证程序集中的命名空间名称。

    有时它们不是您所期望的。

    【讨论】:

      【解决方案3】:

      这就是 Microsoft Visual Studio 的帮助。固定如下:

      using Bing.GData.Extensions;
      using Bing.GData.Contacts;
      using Bing.Contacts;
      using Bing.GData.Client;
      

      【讨论】:

      • @Matt:这不是一个真正的答案——它应该是一个关于 Visual Studio 如何希望您使用“Bing”(bing.com)而不是 Google 的笑话。 (反对票的也是我)
      • @Matt:在我阅读评论之前我也没有明白......实际上有点好笑。
      猜你喜欢
      • 2018-11-29
      • 1970-01-01
      • 2020-12-04
      • 2016-04-22
      • 2019-06-19
      • 1970-01-01
      • 1970-01-01
      • 2010-11-28
      • 2012-10-17
      相关资源
      最近更新 更多