C# JSON.Net在生成时引发异常

C# JSON.Net在生成时引发异常,c#,windows-phone-7,json.net,C#,Windows Phone 7,Json.net,我正在使用WebClient.DownloadStringAsync()下载JSON字符串,并使用JSON.Net的JObject.Parse()将该字符串解析为JSON对象,以便使用LINQ查询该对象。但当我尝试构建解决方案时,它会抛出异常和警告 Reference to type 'System.Func`2' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Si

我正在使用
WebClient.DownloadStringAsync()
下载JSON字符串,并使用JSON.Net的
JObject.Parse()
将该字符串解析为JSON对象,以便使用LINQ查询该对象。但当我尝试构建解决方案时,它会抛出异常和警告

Reference to type 'System.Func`2' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\mscorlib.dll', but it could not be found
使用这些软件包:

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Newtonsoft.Json; //v 6.0.3
using Newtonsoft.Json.Linq;
using System.Runtime.Serialization;
见其他答案:

由于您的目标是WP8之前的Windows Phone版本,因此应使用较旧版本的Newtonsoft.Json


您可以通过
安装软件包Newtonsoft.Json-version 5.0.8
获得版本5.0.8,但之前删除了6.0.3版本。

Silverlight?你不是在WP7项目中吗?你应该尝试在没有这个JSON处理部分的情况下构建你的项目,从一开始就检查它是否是一个问题,因为这个错误似乎没有链接。您能否完全获得引发此错误的引用的名称
System.Func2
您是否尝试安装silverlight?是否导入了正确的包?请尝试清理项目中的引用,手动添加它们,然后清理并重新生成您的包project@NicolasRNewtonsoft.Json.dll引发错误