如何添加引用装配在vs2012 [英] How to add reference to assembly in vs2012

查看:204
本文介绍了如何添加引用装配在vs2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要如何正确使用C#code添加组件的帮助。

I need help on how to correctly add assembly in C# code.

我开始一个空白项目,并试图运行简单的code以下。但引用错误。 我知道,在默认情况下system.dll中被包括在引用文件夹。

I start a blank project and trying to run the simple code below. but has referencing errors. I know by default system.dll is included under the references folder.

那么,为什么它仍然抱怨说,'System.Configuration没有被引用? 我缺少一些手动步骤?如果是的话我怎么办呢?

so why is it still complain that "'System.Configuration is not been referenced"? Am I missing some manual steps? If so how do I do it?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Configuration;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpWebRequestElement ae = new HttpWebRequestElement();
            ae.UseUnsafeHeaderParsing = false;
        }
    }
}

在未引用的程序集定义类型System.Configuration.ConfigurationElement。 您必须添加一个引用程序集System.Configuration,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a'。

The type 'System.Configuration.ConfigurationElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

感谢您帮助

推荐答案

右键单击项目引用,并添加引用 System.Configuration

Right click on project references and add reference to System.Configuration

这篇关于如何添加引用装配在vs2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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