2009-09-14 2 views
1

다른 프로젝트에 DLL을 가져 오면 .config 파일도 가져올 수 있도록 web.config를 여러 구성 파일로 나눠 넣으려고합니다.SubSonic - web.config 나누기

내가 정의했습니다 :

문제는 SubSonicService 함께 configSections

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

/**configsections** 

그러나 이것은 나를에서 configFile 내 웹에서 나중에 속성을 사용하는 것을 허용하지 않습니다 .config.

나는 Web.config를 얻을 오류 :

요소 'SubSonicService이'불완전한 콘텐츠가 있습니다. 예상 가능한 요소 목록 : '제공자'.

팁이 있습니까?

감사합니다.

+1

필자는 더 많은 코드를 게시해야한다고 생각합니다. 중요한 데이터가 없으면 .configs를 많이 게시해야합니다. SubSonicService의 configsecions 정의 SubSonicService configSource = "SubSonic.config" 나는 실종 뭔가 (코드 : –

+0

문제는 아래에 사용되는 정의 secion 이름 SubSonicService는, 불완전하거나 태그로 볼 수 있다는 것 위의 저널은 내가 그 secion에 가지고있는 것이다)? 감사합니다. – ElHaix

답변

2

나는 이것을 가지고 작동한다.

의 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 나는 configSections의 첫 번째 섹션을 확인 SubSonicService을했다 만들기에 대해 뭔가를 읽고 기억

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

합니다.

+0

SubSonic 2.2와 함께 사용하고 있는데 SubSonicService가 configSections의 첫 번째 섹션이 아니라면 제대로 작동합니다. 다른 버전과 다를 수 있습니다. –