C# NewtonsotJson dll不是它的程序集

C# NewtonsotJson dll不是它的程序集,c#,.net,C#,.net,我需要读取.NET3.5中的JSON字符串,然后添加Newtonsoft.JSON.dll。我可以使用此dll的方法,但当我编译并运行我的应用程序时,会发送以下错误: Advertencia 1 La referencia al tipo 'System.DateTimeOffset' indica que está definida en 'c:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\ms

我需要读取.NET3.5中的JSON字符串,然后添加Newtonsoft.JSON.dll。我可以使用此dll的方法,但当我编译并运行我的应用程序时,会发送以下错误:

Advertencia 1   La referencia al tipo 'System.DateTimeOffset' indica que está definida en 'c:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\mscorlib.dll', pero no se pudo encontrar    c:\data\dev\C#\GrucasInvApp\GrucasInvApp\Lib\Newtonsoft.Json.dll    GrucasInvApp
Error   2   El tipo 'System.ComponentModel.INotifyPropertyChanging' está definido en un ensamblado al que no se hace referencia. Debe agregar una referencia al ensamblado 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\data\dev\C#\GrucasInvApp\GrucasInvApp\GUI\LoginForm.cs   45  21  GrucasInvApp
Error   2   El tipo 'System.ComponentModel.INotifyPropertyChanging' está definido en un ensamblado al que no se hace referencia. Debe agregar una referencia al ensamblado 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\data\dev\C#\GrucasInvApp\GrucasInvApp\GUI\LoginForm.cs   45  21  GrucasInvApp

当我注释掉我正在使用库的行时,我的应用程序工作了!:C

转到解决方案的属性,使其成为应用程序3.5。看起来您可能是根据错误的Json.NET版本进行构建的-您是如何安装的,您引用的是哪个版本?(如果您使用NuGet,我希望它会很好……)除Jon的评论外,请注意Json.NET确实为不同的.NET framework目标提供了不同的DLL(如您的项目中所设置的)。这意味着,Json.NET为.NET 4.5提供了一个DLL,例如,它为.NET 3.5提供了另一个DLL。您能否详细说明如何添加
Newtonsoft.Json
程序集引用?如果您像Jon所说的那样使用nuget,它应该为您的project.Net版本自动引用正确的dll。请避免使用其他方法,如手动文件引用。如果您这样做了,那么删除添加的引用并通过nuget重新添加它可能是一个好主意。