How to add reference to assembly in vs2012

假装没事ソ 提交于 2019-12-19 16:34:31

问题


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

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.

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;
        }
    }
}

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'.

Thanks for helping


回答1:


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



来源:https://stackoverflow.com/questions/14743606/how-to-add-reference-to-assembly-in-vs2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!