Portable class library and .NET ConcurrentDictionary

こ雲淡風輕ζ 提交于 2019-12-08 15:45:36

问题


Looking at http://msdn.microsoft.com/en-us/library/dd287191(v=vs.110).aspx, it seems that ConcurrentDictionary and all of its friends in the System.Collections.Concurrent namespace are available for use in a Portable Class Library.

However, when I create either an F# or C# Portable Class Library, even if I explicitly add a reference to mscorlib.dll, the compilation fails when using ConcurrentDictionary.

Why?


回答1:


The term "Portable" should be loosely applied right now. When you create the class library project, you get prompted for the targets you want to support. You'll only get ConcurrentDictionary when you select ".NET Framework" and ".NET for Windows Store apps".

Pick any other and the entire namespace disappears.

This will get better over time, I'd assume, but Windows Phone 7, XBox and Silverlight are lagging behind right now.



来源:https://stackoverflow.com/questions/12202150/portable-class-library-and-net-concurrentdictionary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!