[英]What would be the best .NET 2.0 type to represent .NET 3.5 HashSet<T>?
[英]What is special about HashSet<T> in .NET 3.5?
這是一個有趣的謎題。
我下載了Snippet Compiler來嘗試一些東西,並想編寫以下代碼:
using System;
using System.Collections.Generic;
public class MyClass
{
public static void RunSnippet()
{
HashSet<int> h = new HashSet<int>();
}
}
但是上面的代碼沒有編譯。 我明白了:
“無法找到類型或命名空間名稱'HashSet'(您是否缺少using指令或程序集引用?)”
顯然,我不是。 它似乎找不到HashSet,但它在Systems.Collections.Generic命名空間中找到其他類型(例如List,SortedDictionary)。
對此有何解釋? 假設Snippet Compiler正在使用標准的Framework編譯器......
我很想知道為什么這不起作用。
是你的參考用途
命名空間:System.Collections.Generic
程序集:System.Core(在System.Core.dll中)
版本3.5?
檢查System.Core.dll Snippet編譯器正在使用的版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.