Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近将一个应用程序从 .net 2.0 转换为 3.5,但我没有看到任何扩展方法......我做错了什么?或者除了在项目设置中将目标框架从 2.0 更改为 3.5 之外,我还应该做什么?
扩展方法基于导入的命名空间出现尝试添加
using System.Linq;
到文件的顶部。正如 Jon 所说,您还需要添加对 System.Core.dll 程序集的引用。
您不仅需要按照 SillyMonkey 的建议添加 using 指令,而且如果要使用 LINQ System.Linq,还需要对程序集进行引用。System.Core
System.Linq
System.Core
扩展方法,是 .net 3.5 的特性。扩展方法是你需要创建的东西!!!
什么是扩展方法?
参考这个链接