Custom sectionGroup and Section App.config
Posted
by fampinheiro
on Stack Overflow
See other posts from Stack Overflow
or by fampinheiro
Published on 2010-06-12T11:32:53Z
Indexed on
2010/06/12
11:43 UTC
Read the original article
Hit count: 1057
c#
|app.config
<configSections>
<section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionhandler, Castle.Windsor" />
<sectionGroup name="codegarten">
<section name="configuration" type="Tmp.StartupCodegartenConfigSection, Tmp" />
<section name="apache" type="Tmp.StartupApacheConfigSection, Tmp" />
</sectionGroup>
</configSections>
When i use msdn main to see all the sections i get this error,
Unhandled Exception: System.Configuration.ConfigurationErrorsException: An error
occurred creating the configuration section handler for codegarten/apache: Coul
d not load type 'Tmp.StartupApacheConfigSection' from assembly 'Tmp'. (D:\Codega
rten\trunk\Codegarten\Tmp\bin\Debug\Tmp.exe.Config line 8) ---> System.TypeLoadE
xception: Could not load type 'Tmp.StartupApacheConfigSection' from assembly 'Tm
p'.
at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalCon
figHost host, String typeString, Boolean throwOnError)
at System.Configuration.MgmtConfigurationRecord.CreateSectionFactory(FactoryR
ecord factoryRecord)
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(St
ring configKey, Boolean& isRootDeclaredHere)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(St
ring configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.ConfigurationSectionCollection.Get(String name)
at System.Configuration.ConfigurationSectionCollection.<GetEnumerator>d__0.Mo
veNext()
at Tmp.Program.ShowSectionGroupInfo(ConfigurationSectionGroup sectionGroup) i
n D:\Codegarten\trunk\Codegarten\Tmp\Program.cs:line 53
at Tmp.Program.ShowSectionGroupCollectionInfo(ConfigurationSectionGroupCollec
tion sectionGroups) in D:\Codegarten\trunk\Codegarten\Tmp\Program.cs:line 30
at Tmp.Program.Main(String[] args) in D:\Codegarten\trunk\Codegarten\Tmp\Prog
ram.cs:line 22
Thanks
© Stack Overflow or respective owner