"One or more types required to compile a dynamic expression cannot be found. Are you missing re

Posted willingtolove

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了"One or more types required to compile a dynamic expression cannot be found. Are you missing re相关的知识,希望对你有一定的参考价值。

#事故现场:

  在一个.net 4.0 的项目中使用dynamic,示例代码如下:

1 private static void Main(string[] args)
2 {
3     dynamic obj;
4     obj = new { name = "jack" };
5     Console.WriteLine(obj.name);
6 }

  在读取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 re的主要内容,如果未能解决你的问题,请参考以下文章

one or more

Validation failed for one or more entities. See 'EntityValidationErrors' property for more d

VS2015密匙--VS2015打开丢失msvcp140.dll--cannot find one or more components ,please reinstall the applicati

报错The "chunk" argument must be one of type string or Buffer. Received type object

Validation failed for one or more entities. See 'EntityValidationErrors' property for more d

Validation failed for one or more entities. See 'EntityValidationErrors' property for more d