DatabaseFactory.CreateDatabase() work with web.config but not not app.config

Topics: Data Access Application Block
Aug 29, 2011 at 11:17 PM

I configured the DB access with the Enterprise Configuration Tool.

Aug 30, 2011 at 1:35 AM

Hi,

Can you tell us where did you defined your App.Config? Note that the config should be defined in the context of an executable assembly.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us

Aug 30, 2011 at 4:14 AM

I'm afraid I don't fully understand your question.  The app.config is in its standard location (the main folder).  I didn't do anything to it aside from the Enterprise Configuration Tool.

It looks like this:

<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="IntuitvePlatform" connectionString="Data Source=2UA1060G67;Initial Catalog=IntuitivePlatform;Integrated Security=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>

Aug 30, 2011 at 5:11 AM

Hi,

Apologies for that. To clear things up, is the app.config defined inside an application project (not a class library)? Also can you check in your project properties if you are targeting the whole .NET 4.0 profile. 

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us

 

Aug 31, 2011 at 11:51 PM

The app.config IS defined inside an application project (not a class library).

I am targeting the whole .NET 4.0 profile.

Sep 1, 2011 at 8:01 AM

Did you encounter run time error when calling that method? If yes, can you tell us the exact error message?

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us