![](/img/trans.png)
[英]Add Reference 4.0 Dll to 4.0 ClientProfile application in 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.