gpt4 book ai didi

.net - 可移植类库和.NET ConcurrentDictionary

转载 作者:行者123 更新时间:2023-12-03 00:29:37 25 4
gpt4 key购买 nike

查看http://msdn.microsoft.com/en-us/library/dd287191(v=vs.110).aspx ,看来 ConcurrentDictionary 及其在 System.Collections.Concurrent 命名空间中的所有 friend 都可以在可移植类库中使用。

但是,当我创建 F# 或 C# 可移植类库时,即使我显式添加对 mscorlib.dll 的引用,使用 ConcurrentDictionary 时编译也会失败。

为什么?

最佳答案

“可移植”一词现在应该宽松地应用。创建类库项目时,系统会提示您选择要支持的目标。仅当您选择“.NET Framework”和“.NET for Windows Store apps”时,您才会获得 ConcurrentDictionary。

选择任何其他名称,整个命名空间就会消失。

我认为,随着时间的推移,这会变得更好,但 Windows Phone 7、XBox 和 Silverlight 目前已经落后了。

关于.net - 可移植类库和.NET ConcurrentDictionary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12202150/

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