#事故现场:

  在一个.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的引用;

#参考:

https://stackoverflow.com/questions/11725514/one-or-more-types-required-to-compile-a-dynamic-expression-cannot-be-found-are

——————————————————————————————————————————————————

"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?"的解决方法的更多相关文章

  1. 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 ...

  2. [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 ...

  3. Jenkins 配置邮箱 530Authentication required ,535 uthentication failed 的解决方法

      错误 解决方法 530 Authentication required  需要展开SMTP认证,输入SMTP server能识别的用户信息 535 authentication failed  输 ...

  4. 安装Scrapy报错 error: Microsoft Visual C++ 14.0 is required解决方法

    [问题背景]:在Windows 10系统,pip install Scrapy,报错error: Microsoft Visual C++ 14.0 is required,还有提示Twisted需要 ...

  5. JavaFx出现错误Caused by: java.lang.NullPointerException: Location is required的解决方法

    问题截图: "C:\Program Files\Java\jdk1.8.0_131\bin\java.exe" "-javaagent:I:\IntelliJ IDEA ...

  6. (转)新建maven项目时报错Error:Maven Resources Compiler: Maven project configuration required for module 'XX'解决方法

    转载地址:https://blog.csdn.net/qq784515681/article/details/85070195 在新建maven项目时,Problems中报错: Error:Maven ...

  7. 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 ...

  8. mybatis报错invalid types () or values ()解决方法

      原因: Pojo类User没提供无参数构造方法, 加上该构造方法后,问题解决 ### Cause: org.apache.ibatis.reflection.ReflectionException ...

  9. 'sessionFactory' or 'hibernateTemplate' is required解决方法

    这种情况就是在通过spring配置hibernate4的时候(注意,这里是hibernate4不是hibernate3,hibernate3的),使用的是HibernateDaoSupport的这种方 ...

随机推荐

  1. Git问题汇总

    1.fatal: refusing to merge unrelated histories $git pull origin master --allow-unrelated-histories 2 ...

  2. C语言入门-类型定义

    一.自定义数据类型(typedef) c语言提供一个叫做typedef的功能来声明一个已有的数据类型的新名字,比如: typedef int length; 这样length成为了int类型的别名 这 ...

  3. MyBatis核心对象之StatementHandler

    MyBatis核心对象之StatementHandler StatementHandler ResultHandler ParameterHandler Executor org.apache.iba ...

  4. Ruby入门1

    由于部门的自动化是由一个前辈实现的,他使用的Ruby的语言来实现的,所以需要学习一下Ruby语言,争取在15天左右可以掌握Ruby语言!加油~~~ 1.常量&变量 # 1.常量 # 一般用大写 ...

  5. PAT 1011 World Cup Betting 查找元素

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...

  6. maven配置阿里云仓库镜像

    全局配置 修改settting文件 在mirrors标签下添加子节点. <mirror> <id>nexus-aliyun</id> <mirrorOf> ...

  7. css3动画如何解决动画的播放、暂停和重新开始

    0921自我总结 css3如何解决动画的播放.暂停和重新开始 一.解决的本质思路 播放的解决思路 先定义好动画效果通过类名的增加达到样式的出现 暂停的解决思路 我们播放动画时,如要暂停动画,就要用到a ...

  8. .netcore控制台->定时任务Quartz

    之前做数据同步时,用过timer.window服务,现在不用那么费事了,可以使用Quartz,并且配置灵活,使用cron表达式配置XML就可以.我用的是3.0.7版本支持.netcore. 首先创建一 ...

  9. iOS----------文字逐个显示

    参考文档: https://blog.csdn.net/et295394330/article/details/50529862

  10. 一文解读MVC/MVP/MVVM (转)

    这篇文章对目前 GUI 应用中的 MVC.MVP 和 MVVM 架构模式进行详细地介绍. MVC 在整个 GUI 编程领域,MVC 已经拥有将近 50 年的历史了.早在几十年前,Smalltalk-7 ...