المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Loading app.config from a remote ******** fails to load section handler.



C# Programming
11-13-2009, 07:51 AM
Hi guys.

We're trying to implement a centralized configuration for all .net applications and by so we have created a master configuration at a specific ********. We're then creating a custom configuration manager that uses both the local app.config and the centralized master configuration.

The master configuration is read using System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(string path, UserLevel level).
The appSettings section and all other custom sections are read and available but our problem occurs when we try to read the sections from the master configuration using ConfigurationManager.GetSection(string sectionName).

We get a TypeLoadException no matter what type of section handlers we use - .NET handlers or custom handlers, and the method returns a System.Configuration.DefaultSection object instead of the intended type.

Could not load type 'System.Configuration.NameValueSectionHandler' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Reading the same sections from the app.config of the exectuable produces no errors.

Anybody with some ideas as to what causes the problem?

-Larantz

for those about to code, we salute you
Please refer to the Forum Guidelines (http://www.codeproject.com/scrapbook/ForumGuidelines.asp) for appropriate posting.