Using HashSet in C# 2.0, compatible with 3.5

后端 未结 6 1822
鱼传尺愫
鱼传尺愫 2020-11-30 10:17

I really want to use hashsets in my program. Using a dictionary feels ugly. I\'ll probably start using VS2008 with .Net 3.5 some day, so my ideal would be that even though

6条回答
  •  失恋的感觉
    2020-11-30 10:25

    You can use HashSet in a 2.0 application now - just reference System.Core.dll and you should be good to go.

    Note: This would require you to install the .NET 3.5 framework which is free and separate from Visual Studio. Once you have that installed you will have the new System.Core assembly which contains the HashSet type. Since the .NET frameworks versions 2.0 - 3.5 all share the same CLR you can use this assembly in your 2.0 application without any issues.

提交回复
热议问题