Click here to Skip to main content
15,917,601 members
Home / Discussions / C#
   

C#

 
QuestionLoading app.config from a remote location fails to load section handler. Pin
Larantz11-Nov-09 22:57
Larantz11-Nov-09 22:57 
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 location. 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 for appropriate posting.

AnswerRe: Loading app.config from a remote location fails to load section handler. Pin
Shameel11-Nov-09 23:38
professionalShameel11-Nov-09 23:38 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Larantz11-Nov-09 23:40
Larantz11-Nov-09 23:40 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Larantz11-Nov-09 23:50
Larantz11-Nov-09 23:50 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Shameel12-Nov-09 0:00
professionalShameel12-Nov-09 0:00 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Larantz12-Nov-09 0:11
Larantz12-Nov-09 0:11 
Questionadd row to data grid view problem Pin
Rinad11-Nov-09 22:51
Rinad11-Nov-09 22:51 
AnswerMessage Closed Pin
11-Nov-09 22:55
stancrm11-Nov-09 22:55 
GeneralRe: add row to data grid view problem Pin
Rinad11-Nov-09 23:31
Rinad11-Nov-09 23:31 
GeneralRe: add row to data grid view problem Pin
Gerry Schmitz12-Nov-09 1:39
mveGerry Schmitz12-Nov-09 1:39 
GeneralRe: add row to data grid view problem Pin
Luc Pattyn12-Nov-09 2:34
sitebuilderLuc Pattyn12-Nov-09 2:34 
QuestionInheritence Pin
sris 42611-Nov-09 22:27
sris 42611-Nov-09 22:27 
AnswerRe: Inheritence Pin
The Man from U.N.C.L.E.11-Nov-09 22:38
The Man from U.N.C.L.E.11-Nov-09 22:38 
GeneralRe: Inheritence Pin
sris 42611-Nov-09 22:59
sris 42611-Nov-09 22:59 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 23:09
professional dan!sh 11-Nov-09 23:09 
GeneralRe: Inheritence Pin
sris 42611-Nov-09 23:14
sris 42611-Nov-09 23:14 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 23:23
professional dan!sh 11-Nov-09 23:23 
GeneralRe: Inheritence Pin
The Man from U.N.C.L.E.12-Nov-09 5:05
The Man from U.N.C.L.E.12-Nov-09 5:05 
GeneralRe: Inheritence Pin
sris 42612-Nov-09 5:33
sris 42612-Nov-09 5:33 
GeneralRe: Inheritence Pin
The Man from U.N.C.L.E.12-Nov-09 5:45
The Man from U.N.C.L.E.12-Nov-09 5:45 
GeneralRe: Inheritence Pin
PIEBALDconsult12-Nov-09 6:00
mvePIEBALDconsult12-Nov-09 6:00 
GeneralRe: Inheritence Pin
sris 42612-Nov-09 6:08
sris 42612-Nov-09 6:08 
AnswerRe: Inheritence Pin
Eduard Keilholz11-Nov-09 22:45
Eduard Keilholz11-Nov-09 22:45 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 22:53
professional dan!sh 11-Nov-09 22:53 
AnswerRe: Inheritence Pin
PIEBALDconsult12-Nov-09 4:11
mvePIEBALDconsult12-Nov-09 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.