I am having some weird problem.
When using this code I am unable to build, however it gives me no build errors.

the code

public void myMethod()
{              
    //This returns a string in JSON format.
    var jsonResponse = myApi.ReadMobileDevice("1");


    dynamic dynamicJson= JsonConvert.DeserializeObject(jsonResponse);

    //THIS LINE BREAKS MY BUILD. NO BUILD ERRORS SHOWN
    var jValue = dynamicJson["general.display_name"];
}

有人能告诉我为什么我的构建会出错,以及为什么没有显示构建错误吗

UPDATE - Output

1>------ Build started: Project: Control, Configuration: Debug x86 ------
1>  Restoring NuGet packages...
1>  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
1>  All packages listed in packages.config are already installed.
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(563,28,563,40): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
1>C:\ActacomProjects\DEV-Google\Control\Classes\DomainObjects\Schedules\HTTPSchedulesResponse.cs(41,34,41,36): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\Classes\DomainObjects\Schedules\HTTPSchedulesResponse.cs(87,30,87,32): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1225,26,1225,45): warning CS0219: The variable 'recreateApplication' is assigned but its value is never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1809,71,1809,74): warning CS0168: The variable 'dnf' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1813,54,1813,56): warning CS0168: The variable 'ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5017,34,5017,36): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5087,42,5087,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5154,42,5154,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5192,42,5192,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5267,42,5267,44): warning CS0168: The variable 'Ex' is declared but never used
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

推荐答案

您的输出中有此错误:

Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

您需要添加对DLL Microsoft.CSharp.dll的引用.

Json相关问答推荐

在T—SQL中将STR_AGG与JSON_ARRAY结合起来

如何使用GoFr返回XML响应?

GO KaZaam转换返回意外结果

使用JQ将对象数组转换为平面数组

使用jq过滤复杂json对象中的数据

使用 jq 如何更改键的值?

将不带正文的 CURL POST 转换为 RESTRequest Delphi 代码 / 为 Dropbox API /get_current_account 端点编写 Delphi 代码

jq json - 按键名 Select

jq搜索特定字符串并输出对应的父值

Microsoft GRAPH 查询使用端点 /deviceManagement/deviceHealthScripts 列出了一种不熟悉的检测脚本内容格式

如何使用 ConfigurationBuilder 解析现有的 json 字符串(不是文件)

如何在 jQuery 中循环遍历 JSON 数组?

ASP.NET MVC - 将 Json 结果与 ViewResult 结合起来

Flask 请求和 application/json 内容类型

Android JSON 库的性能和可用性比较

在 JSON 编码的 HTML5 数据属性中转义/编码单引号

C#扁平化json struct

Java循环遍历Json数组?

如何判断 JSON 响应元素是否为数组?

通过 JSON 发送 HTML 代码