views:

194

answers:

1

I'm trying to divide up my web.config into multiple config files so that when I import the DLL to other projects, the .config files will also be imported.

Issue is with SubSonicService:

I've defined: configSections

  *section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/*

/**configsections**

But this doesn't allow me to use the configFile attribute later on in my web.config.

The error I get in the web.config is:

The element 'SubSonicService' has incomplete content. List of possible elements expected: 'providers'.

Any tips?

Thanks.

+2  A: 

I have this and it works.

web.config

<configuration>
  <configSections>
    <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
   <!--Other Sections-->
  </configSections>

  <SubSonicService configSource="SubSonic.config"/>

  <!--Other Stuff-->
</configuration>

SubSonic.config

<SubSonicService defaultProvider="yadayada">
  <providers>
    <!--List Providers Hers-->
  </providers>
</SubSonicService>

I remember reading something about making sure SubSonicService was the first section in the configSections.

ranomore
I'm using this in conjunction with SubSonic 2.2 and it works fine with SubSonicService not being the first section in configSections. Might be different with different versions.
jlech