asp.net mvcview界面does not contain a definition

  在cshtml使用linq操作数据集,自动补全是可以使用Select,但是一直提示System.Collection.GenericList' does not contain a definition for 'Select' ccepting a first argument of type 'System.Collections.GenericList' could be found (are you missing a using directive or an assembly reference?)。

  一段没有特殊写法的代码,一直觉得肯定是一个很傻的操作引起的,但是引用System.Linq,仍然报错,就开始怀疑是不是整个项目引用有问题。后来把dll全部重新引用一遍,折腾了很久,但是结果还是没有解决。不经意间发现头部的@使用上,少了一个},补全后就恢复正常了。

  开发过程时常遇到莫名其妙的问题,大部分是不小心造成的,仔细检查代码就可以了