.NET 3.5中的HashSet <T>有什么特别之处?

Cra*_*rer 2 .net c# .net-3.5 code-snippets

这是一个有趣的谜题.

我下载了Snippet Compiler来尝试一些东西,并想编写以下代码:

using System;
using System.Collections.Generic;

public class MyClass
{
    public static void RunSnippet()
    {
        HashSet<int> h = new HashSet<int>();
    }
}
Run Code Online (Sandbox Code Playgroud)

但是上面的代码没有编译.我明白了:

"无法找到类型或命名空间名称'HashSet'(您是否缺少using指令或程序集引用?)"

显然,我不是.它似乎找不到HashSet,但它在Systems.Collections.Generic命名空间中找到其他类型(例如List,SortedDictionary).

对此有何解释?假设Snippet Compiler正在使用标准的Framework编译器......

我很想知道为什么这不起作用.

Fre*_*dou 5

是你的参考用途

命名空间:System.Collections.Generic

程序集:System.Core(在System.Core.dll中)

版本3.5?