This is a migrated thread and some comments may be shown as answers.
configuration from web.config doesn't override app.config
1 Answer 65 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Devanand Chahal
Top achievements
Rank 2
Devanand Chahal asked on 05 Oct 2009, 08:54 AM

We have a connection string tag in each of the app.config  of the project and in web.config file. Now during the deployement we change the connection string as per the new environment in the web.config. Ideally the connection setting in web.config should override the the connection settings for all the DLLs, but this is not happening currently. We have  to change the connection string for each project in app.config and compile , to make it work.

Please let us know if any settings needs to checked foropwn access , that will automatically override the connection string from web.config.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 07 Oct 2009, 07:40 AM
Hello Devanand Chahal,

You do not need the connection nodes anymore in the app.config files. Just create a <connections> section in the Web.config and move there the <connection> nodes from the app.config files. Please make sure that if an assembly needs the Update Database property set to True, you should enable this option for the Web project and disable it for the class library. The point is that the UpdateDatabase property should be set only for the project, containing the connection settings. 
Note that the other assemblies should still hold the definitions of your persistent classes.
Please also verify that you have references to the compiled assemblies in the web.config. The reference section should look something like this:
    <reference assemblyname="ClassLibrary1" configrequired="True"/>  
    <reference assemblyname="ClassLibrary2" configrequired="True"/>  
If you do not have such node, run the Enable project wizard for the web site and it will be automatically created.

the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
General Discussions
Asked by
Devanand Chahal
Top achievements
Rank 2
Answers by
Telerik team
Share this question