Keep getting activation error occured ... Error

Topics: Data Access Application Block, Enterprise Library Core
Jul 18, 2013 at 2:46 PM

I have configured an app.config file to connect to my SQL Server 2008 Database. It was working before but now I keep getting activation error occured while trying to get instance of type Database error. I reviewed my .config file and it seems OK. By the way, .config file is in another project which produces a library that I use in another project (Side by Side projects).

Here is my .config file
<?xml version="1.0" encoding="utf-8" ?>
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
    <dataConfiguration defaultDatabase="Core" />
        <add name="Core" connectionString="Server=******\******;Database=******;User Id=**;Password=*******;"
            providerName="System.Data.SqlClient" />
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
            <add name="DefaultSwitch" value="Information" />
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
Any help would be apperciated.

Jul 19, 2013 at 6:58 AM
The error usually means that there is a configuration issue. The configuration needs to be in the app.config or web.config of the application . So if you have the Enterprise Library configuration in a config file in another project the config information will need to be placed in the config file of the application project, or loaded through some other means (programmatic, redirected sections, file configuration source, etc.).

Randy Levy
Enterprise Library support engineer
Support How-to