【问题标题】:NameValueCollection not available from System.Collections.SpecializedSystem.Collections.Specialized 不提供 NameValueCollection
【发布时间】:2013-10-13 17:32:59
【问题描述】:

在 VS 2012 Express for Windows Phone 中,我同时使用了 SystemSystem.Collections.Specialized 的导入,但在尝试使用 NameValueCollection 时仍然出现错误。

查看对象浏览器,我看到它嵌套在 System.dll 中,但列出了多个版本的 System dll - 其中一些没有。我在自动完成中得到的内容与 System.dll without NameValueCollection 中的可用项目匹配,所以我想我需要弄清楚正在使用哪个 System.dll,但我不是知道该怎么做。

有人可以帮我使用NameValueCollection吗?

我拥有的系统版本是: 2.0.0.0(有)-.NET 2,3,3.5 2.0.5.0 运行时 2.0.5xxx(没有) Silverlight 4 2.0.5.0 运行时 4.0.3xxx(没有) Windows Phone 8 4.0.0.0(有)-.NET 4.0

【问题讨论】:

  • 手机本身当然只有一个特定版本的System.dll。它是你在开发机器上找到的那些经过大量修剪的版本。因此,您必须在项目中使用正确的参考程序集,以免意外使用不可用的类。喜欢 NameValueCollection。

标签: .net reference windows-phone namevaluecollection


【解决方案1】:

NameValueCollection 不适用于 Windows Phone。您可以改用Dictionary<string, string>

【讨论】:

    猜你喜欢
    • 2017-07-27
    • 2011-11-22
    • 1970-01-01
    • 1970-01-01
    • 2012-11-19
    • 1970-01-01
    • 1970-01-01
    • 2014-07-09
    • 1970-01-01
    相关资源
    最近更新 更多