Ever since we upgraded to .Net 4.0 and VS2010 (from 3.5 and 2008) we can no longer get intellisense on LINQ to kick in when working in our views. Before the upgrade everything was working fine, bu开发者_Python百科t after the upgrade it's actually listed as an error when we try to use things like .Where() on a collection. Oddly it will compile fine and run, but this makes it very annoying when writing LINQ in our views.
Specifically the errors list things like "System.Collections.Generic.List does not contain a definition for 'Where' and no extension method 'Where' accepting fist argument of type System.Collections.Generic.List could be found".
I've tried adding the System.Data.Linq assembly and the System.Core assembly to the web config with no luck.
Any ideas?
When the upgrade was performed it forgot to add the attribute of targetFramework
to the compilation
element in your web.config:
<system.web>
<compilation debug="true" targetFramework="4.0">
Add that to your web.config and you should regain intellisense again in your views.
精彩评论