编译一个动态的前pression所需的一个或多个类型不能被发现。是否缺少引用Microsoft.CSharp.dll和System.Core.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?

查看:168
本文介绍了编译一个动态的前pression所需的一个或多个类型不能被发现。是否缺少引用Microsoft.CSharp.dll和System.Core.dll的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编译这个code在Microsoft Visual C#2010

I am trying to compile this code in Microsoft Visual C# 2010

using System;
using System.Globalization;


class main
{
    static void Main()
    {

        dynamic d;
        d = "dyna";
        Console.WriteLine(d);    
    }
}

但我收到这两个错误

but I am getting these two errors

1 predefined型'Microsoft.CSharp.RuntimeBinder.Binder没有定义或导入错误

编译动态EX pression所需的错误2的一个或多个类型不能被发现。是否缺少引用Microsoft.CSharp.dll和System.Core.dll的?

我读这其他<一href="http://stackoverflow.com/questions/7115055/why-am-i-getting-one-or-more-types-required-to-compile-a-dynamic-ex$p$pssion-can">post但我是新来的C#,我不明白到底是什么问题。尤其是什么,在哪里都是这些所谓的的.config 文件..

I read this other post but I am new to C# and I couldn't understand what really is the problem. Especially what and where are these so called .config files..

推荐答案

在您的解决方案浏览器窗口中,右键单击引用,选择Add Reference,进入.NET选项卡,找到并添加Microsoft.CSharp。

On your solution explorer window, right click to References, select Add Reference, go to .NET tab, find and add Microsoft.CSharp.

这篇关于编译一个动态的前pression所需的一个或多个类型不能被发现。是否缺少引用Microsoft.CSharp.dll和System.Core.dll的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆