1. 程式人生 > >加入using System.Configuration;名稱空間後軟體提示錯誤的處理

加入using System.Configuration;名稱空間後軟體提示錯誤的處理

軟體在加入using System.Configuration;語句後, 在引入ConnectionStrings等引數時出現
The name 'ConfigurationManager' does not exist in the current context錯誤,其原因是僅手動引入未System.Configuration名稱空間未在軟體中新增System.Configuration.dll引用,新增Configuration的引用。

  1. Right-click on the References / Dependencies
  2. Choose Add Reference
  3. Find and add System.Configuration.Find and add System.Configuration.

在這裡插入圖片描述

參閱:https://stackoverflow.com/questions/1274852/the-name-configurationmanager-does-not-exist-in-the-current-context