"One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?"的解决方法
#事故现场:
在一个.net 4.0 的项目中使用dynamic,示例代码如下:
private static void Main(string[] args)
{
dynamic obj;
obj = new { name = "jack" };
Console.WriteLine(obj.name);
}
在读取obj.name时,报错:
One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?
#解决方法:
在项目中,添加Microsoft.CSharp.dll的引用;

#参考:
——————————————————————————————————————————————————
"One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?"的解决方法的更多相关文章
- One or more types required to compile a dynamic expression cannot be found.
This is because dynamic keyword is a new C# keyword. So we need to import Microsoft.CSharp.dll. Here ...
- [SQL ERROR 800]Corresponding types must be compatible in CASE expression.
SQL应用报错800.Corresponding types must be compatible in CASE expression. 错误描述: 11:00:51 [SELECT - 0 ro ...
- Jenkins 配置邮箱 530Authentication required ,535 uthentication failed 的解决方法
错误 解决方法 530 Authentication required 需要展开SMTP认证,输入SMTP server能识别的用户信息 535 authentication failed 输 ...
- 安装Scrapy报错 error: Microsoft Visual C++ 14.0 is required解决方法
[问题背景]:在Windows 10系统,pip install Scrapy,报错error: Microsoft Visual C++ 14.0 is required,还有提示Twisted需要 ...
- JavaFx出现错误Caused by: java.lang.NullPointerException: Location is required的解决方法
问题截图: "C:\Program Files\Java\jdk1.8.0_131\bin\java.exe" "-javaagent:I:\IntelliJ IDEA ...
- (转)新建maven项目时报错Error:Maven Resources Compiler: Maven project configuration required for module 'XX'解决方法
转载地址:https://blog.csdn.net/qq784515681/article/details/85070195 在新建maven项目时,Problems中报错: Error:Maven ...
- pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely错误解决方法
pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be sa ...
- mybatis报错invalid types () or values ()解决方法
原因: Pojo类User没提供无参数构造方法, 加上该构造方法后,问题解决 ### Cause: org.apache.ibatis.reflection.ReflectionException ...
- 'sessionFactory' or 'hibernateTemplate' is required解决方法
这种情况就是在通过spring配置hibernate4的时候(注意,这里是hibernate4不是hibernate3,hibernate3的),使用的是HibernateDaoSupport的这种方 ...
随机推荐
- rocksdb学习笔记
rocksdb是在leveldb的基础上优化而得,解决了leveldb的一些问题. 主要的优化点 1.增加了column family,这样有利于多个不相关的数据集存储在同一个db中,因为不同colu ...
- MySQL数据库:函数的应用
字符串截取 # 从左边开始 第1个字符 left(字段名,1) # 从那里开始,截取几个 substring(字段名,1,1) str函数 # 连接字符串 concat(s1,s2,s3,--,sn) ...
- supervisor 工具使用
最近项目要使用supervisor 来管理程序,简单查了查,发现比较容易使用: 中文博客查了查,发现很多人都写出了教程,我这边就懒得写了,找了几个能看懂的记录如下: https://www.cnblo ...
- robotframework框架 - 利用RequestsLibrary关键字轻松实现接口自动化!
robotframework(后续简称为robot)是一款自动化测试框架,可能做各种类型的自动化测试. 本文介绍通过robotframework来做接口测试. 第一步:安装第三方库,提供接口测试的关键 ...
- docker Dockerfile里使用的命令说明
一,dockerfile格式 注释# 指令 参数 指令不区分大小写,但是推荐全部大写指令. 指令从上到下顺序被执行 第一个指令必须是[FROM],指示出要使用的基础镜像. 执行docker file时 ...
- 在vue-cli3中使用axios获取本地json
在vue-cli3中,公共文件夹由static变成了public 先把要访问的json放到public文件夹下 使用axios的get方法获取,不能用post,不然会报404 axios..json` ...
- Navicat Premium连接mongodb基本使用和介绍
Navicat premium是一款数据库管理工具,是一个可多重连线资料库的管理工具, 它可以让你以单一程式同时连线到 MySQL.SQLite.Oracle 及 PostgreSQL,mongodb ...
- 深入理解 Java 异常
- docker redis实现主从复制
1.使用docker启动三个redis实例,容器名称分别为:myredis-master-6379,myredis-slave-6380,myredis-slave-6381.通过命令可以看到容器给三 ...
- 使用NodeJS模块-NodeJS官方提供的核心模块
除了使用自己写的本地模块以外,NodeJS可以使用另外两种类型的模块,分别是NodeJS官方提供的核心模块和第三方提供的模块 NodeJS官方提供的核心模块 NodeJS平台自带的一套基本的功能模块, ...