Keep getting activation error occured ... Error

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

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" ?>
<configuration>
    <configSections>
        <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" />
    </configSections>
    <dataConfiguration defaultDatabase="Core" />
    <connectionStrings>
        <add name="Core" connectionString="Server=******\******;Database=******;User Id=**;Password=*******;"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.diagnostics>
        <sources>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information" />
        </switches>
        <sharedListeners>
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
                 initializeData="FileLogWriter"/>
            <!-- 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"/> -->
        </sharedListeners>
    </system.diagnostics>
</configuration>
Any help would be apperciated.

Fersad.
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
entlib.support@live.com
Enterprise Library support engineer
Support How-to