1

I am using a class library with an app.config and using the dll reference of this library in my web project and I am getting the error shown in the title. Here is the code in my class library and 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;
}

and

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

Any suggestion?

bala3569
  • 10,832
  • 28
  • 102
  • 146

1 Answers1

0

I had the same problem and was related to my App.Config configuration file. I used the Enterprise Library Configuration tool, then open the App.Config of my project in the Enterprise Library Configuration tool realized default settings and saved the file, and it worked properly.

Renan Barbosa
  • 1,046
  • 3
  • 11
  • 31