繁体   English   中英

如何在vs2012中添加对程序集的引用

[英]How to add reference to assembly in vs2012

我需要有关如何在C#代码中正确添加程序集的帮助。

我开始一个空白项目,并尝试运行下面的简单代码。 但存在引用错误。 我知道默认情况下,references文件夹中包含system.dll。

那么为什么仍然抱怨“未引用'System.Configuration”? 我是否缺少一些手动步骤? 如果是这样,我该怎么办?

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,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'的引用。

感谢您的帮助

右键单击项目引用,然后添加对System.Configuration引用

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM