This is a migrated thread and some comments may be shown as answers.

[Solved] Configuration in app.config

2 Answers 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fabio Renggli
Top achievements
Rank 1
Fabio Renggli asked on 22 Feb 2011, 02:31 PM
We have recently updated from Q3 2009 to Q3 2010.

In the earlier version we were able to have our backend configuration (logging, caching) in the app.config As now in the new version the configuration done in the GUI is written to the generated .cs file.

Is there a way, it can be done in the app.config again?
And where is the documentation for the latest version anyway?

Regards

2 Answers, 1 is accepted

Sort by
0
Fabio Renggli
Top achievements
Rank 1
answered on 25 Feb 2011, 11:13 AM
Telerik team explained:
"Actually the backend configuration can only be defined in code now and you are not able to define it in app.config with the new version."
0
Zoran
Telerik team
answered on 28 Feb 2011, 07:53 PM
Hi Fabio Renggli,

 I think that the best approach here would be for you to implement your own xml configuration and read from it in code in order to construct a BackendConfiguration object. That way you can control the number of properties that you configure as well as the format and file that you save them into:

public void BackendConfiguration GetEffectiveBackendConfiguration()
{
       BackendConfiguration backend = new BackendConfiguration();
       backend.ConnectionPool.Timeout = YourCustomXmlConfigurationManager.ReadXmlAttribute("connection-timeout");
       backend.SecondLevelCache.Enabled = YourCustomXmlConfigurationManager.ReadXmlAttribute("cache-enabled");
 
       return backend;
}

The above pseudo-code should be self-explaining about the approach I propose for you. The other way for you to continue your development with OpenAccess and still be able to configure the backend configuration in app.config is to still use the old API and wizards which are still fully supported. 


All the best,
Zoran
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Fabio Renggli
Top achievements
Rank 1
Answers by
Fabio Renggli
Top achievements
Rank 1
Zoran
Telerik team
Share this question
or