如何在vs2012中添加对程序集的引用 [英] How to add reference to assembly in vs2012
问题描述
我需要有关如何在 C# 代码中正确添加程序集的帮助.
I need help on how to correctly add assembly in C# 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, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"的引用.
感谢您的帮助
推荐答案
右键单击项目引用并添加对System.Configuration
Right click on project references and add reference to System.Configuration
这篇关于如何在vs2012中添加对程序集的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!