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 I can’t (or can I?) use hashsets in VS2005, when I start using .NET 3.5, I don’t want to have to change much, if anything, in order to switch to using these hashsets.
I am wondering if anyone is aware of an existing hashset implementation designed with this in mind, or a way to use the 3.5 hashset in VS2005.
You can use
HashSet<T>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<T>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.