<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Dave&amp;#39;s Blog : Schema</title><link>http://blogs.iis.net/davcox/archive/tags/Schema/default.aspx</link><description>Tags: Schema</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Adding simple custom schema to IIS Configuration</title><link>http://blogs.iis.net/davcox/archive/2007/10/31/adding-simple-custom-schema-to-iis-configuration.aspx</link><pubDate>Wed, 31 Oct 2007 16:27:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1983559</guid><dc:creator>davcox</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/davcox/rsscomments.aspx?PostID=1983559</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/davcox/commentapi.aspx?PostID=1983559</wfw:comment><comments>http://blogs.iis.net/davcox/archive/2007/10/31/adding-simple-custom-schema-to-iis-configuration.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Let's see if I can get 2 blog posts written in the same month!&amp;nbsp; :)&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;As I was talking last post, our team had an app-building week (everyone will see the results over the next couple months; there were some VERY cool tools that I'm excited for people to see).&amp;nbsp; I wanted to document part of my journey on getting a custom schema added.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;One thing that I noted is that it's important to make sure your schema file is well-formed XML, or all sorts of tools will choke in various ways.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I looked at the existing iis_schema.xml for examples of various elements that I could use.&amp;nbsp;&amp;nbsp; Also, this&amp;nbsp;IIS.net article is extremely helpful in getting started:&amp;nbsp; &lt;A href="http://www.iis.net/articles/view.aspx/IIS7/Extending-IIS7/Extending-IIS7-Configuration/Extending-IIS7-Schema-and-Accessing-the-custom-sec" mce_href="http://www.iis.net/articles/view.aspx/IIS7/Extending-IIS7/Extending-IIS7-Configuration/Extending-IIS7-Schema-and-Accessing-the-custom-sec"&gt;http://www.iis.net/articles/view.aspx/IIS7/Extending-IIS7/Extending-IIS7-Configuration/Extending-IIS7-Schema-and-Accessing-the-custom-sec&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;I ended up creating this schema:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 11.0pt"&gt;&lt;FONT face=Arial size=2&gt;&amp;lt;configSchema&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;sectionSchema name="ENC-Pony"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;attribute name="CanIHaveAPonyPlease" type="bool" defaultValue="false" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;attribute name="YesResponse" type="string"&amp;nbsp; defaultValue="Yes, you can have a pony" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;attribute name="NoResponse" type="string"&amp;nbsp; defaultValue="No, you cannot have a pony" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;element name="ponies"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;collection addElement="add" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;attribute name="PonyLocationType" type="enum" defaultValue="AsciiFile"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enum name="AsciiFile" value="0" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enum name="ImageFile" value="1" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;enum name="HttpLink" value="2" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/attribute&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;attribute name="value" type="string" validationType="nonEmptyString" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/collection&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/element&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/sectionSchema&amp;gt;&lt;BR&gt;&amp;lt;/configSchema&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;
&lt;P mce_keep="true"&gt;I wanted to automate adding my custom Section to the IIS config system, so I saw that MVolo has a tool to do just that; it works great.&amp;nbsp; It's really just adding one line to applicationhost.config, but it's easier said than automated.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;The line that needs to be added to the &amp;lt;configSections&amp;gt; element&amp;nbsp;is:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;section name="ENC-Pony" overrideModeDefault="Allow" allowDefinition="Everywhere" /&amp;gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here is the iisschema.exe tool which will let you add this line item automatically.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://mvolo.com/blogs/serverside/archive/2007/08/04/IISSCHEMA.EXE-_2D00_-A-tool-to-register-IIS7-configuration-sections.aspx" mce_href="http://mvolo.com/blogs/serverside/archive/2007/08/04/IISSCHEMA.EXE-_2D00_-A-tool-to-register-IIS7-configuration-sections.aspx"&gt;http://mvolo.com/blogs/serverside/archive/2007/08/04/IISSCHEMA.EXE-_2D00_-A-tool-to-register-IIS7-configuration-sections.aspx&lt;/A&gt;&amp;nbsp; &lt;BR&gt;&lt;A href="http://www.harbar.net/archive/2007/08/08/IISSCHEMA.EXE--A-tool-to-register-IIS7-configuration-sections.aspx" mce_href="http://www.harbar.net/archive/2007/08/08/IISSCHEMA.EXE--A-tool-to-register-IIS7-configuration-sections.aspx"&gt;http://www.harbar.net/archive/2007/08/08/IISSCHEMA.EXE--A-tool-to-register-IIS7-configuration-sections.aspx&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;At this point, I could read and write configuration through tools like appcmd and the rest of the configuration stack (including the UI Configuration Editor module).&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;The next post will be how to develop a managed module that runs in the IIS pipeline.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1983559" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/davcox/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/davcox/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.iis.net/davcox/archive/tags/Config/default.aspx">Config</category></item></channel></rss>