我正在使用一个带有 app.config 的类库,并在我的 Web 项目中使用该库的 dll 引用,我得到了标题中显示的错误。这是我的类库和 app.config 中的代码
public List<EppActualsBEO> GetEppActualsList(String requestId)
{
List<EppActualsBEO> listitem = new List<EppActualsBEO>();
try
{
Database database = EnterpriseLibraryContainer.Current.GetInstance<Database>("DatabaseConnection");
command = database.GetSqlStringCommand(query.GetEPPredictionActualsQuery(requestId));
dr = database.ExecuteReader(command);
}
catch (Exception err)
{
throw err;
}
finally
{
dr.Close();
}
return listitem;
}
和
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral"/>
</configSections>
<dataConfiguration defaultDatabase="DatabaseConnection"/>
<connectionStrings>
<add name="DatabaseConnection"
connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=****)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME= ****)));User Id= ****;Password= ****;Persist Security Info=True;"
providerName="System.Data.OracleClient" />
</connectionStrings>
</configuration>
有什么建议吗?