2011-06-30 6 views
1

MVC3で作業しようとしています。linqを使用して、XMLファイルから名前のリストを抽出しています。MVCのLinqが参照の不一致を訴えて

Error 1 
    Could not find an implementation of the query pattern for 
    source type 'System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement>'. 
    'OrderBy' not found. Are you missing a reference to 'System.Core.dll' or a 
    using directive for 'System.Linq' 

私がチェックしたとSystem.Coreは、参照するフォルダにあり、ファイル内のusing System.Linq;文があります:

List<String> firstNames = (from p in x.Descendants("Row") 
          orderby p.Element("id").Value 
          select p.Element("firstName").Value).ToList(); 

コンパイラが文句を続けています。

これはなぜ起こっているのですか?

答えて

1

あなたのコードにこれを追加し

using System.Xml.Linq; 
関連する問題