는 사용자 정의 구성 섹션에 대한 XML 스키마 문서를 제공 할 필요가 말한다. 일부 글로벌 디렉토리에 .xsd
스키마 파일을 추가 할 필요가 없습니다. 당신은 App.config
파일에 사용자 정의 섹션에서 직접 참조 할 수 있습니다 :
<configuration>
<!-- make the custom section known to .NET's configuration manager -->
<configSections>
<section name="customSection" type="..." />
</configSections>
<!-- your custom section -->
<customSection xmlns="http://tempuri.org/customSection.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="customSection.xsd">
...
</customSection>
<configuration>
xmlns
속성은 당신이 당신의 customSection
요소 모두에 설정할 필요가 없도록, 기본 네임 스페이스를 설정하는 단지가 그 자식 요소. (단, <configuration>
요소에 xmlns
속성을 배치하지 마십시오!)가 customSection.xsd
예를 들어, 인텔리가 사용할 스키마를 포함
:
<xs:schema id="customSectionSchema"
targetNamespace="http://tempuri.org/customSection.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/customSection.xsd"
xmlns:mstns="http://tempuri.org/customSection.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="customSection">
...
</xs:element>
</xs:schema>
+1 수용된 솔루션은 널리 실용화 된 것처럼 보이지만 스키마 변경이 표준이며 컴퓨터에서 생성 될 수있는 모든 Visual Studio 프로젝트에 유용하지 않으면이 작업을 수행하지 않아야합니다. (http://msdn.microsoft.com/ ko-kr/library/ms255821.aspx) – Paul