<?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>Kanwaljeet Singla&amp;#39;s Blog : Genscode</title><link>http://blogs.iis.net/ksingla/archive/tags/Genscode/default.aspx</link><description>Tags: Genscode</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>GenSCode updated to help use AhAdmin in C#, JavaScript</title><link>http://blogs.iis.net/ksingla/archive/2008/06/15/genscode-updated-to-help-use-ahadmin-in-c-javascript.aspx</link><pubDate>Sun, 15 Jun 2008 18:25:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2424369</guid><dc:creator>ksingla</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/ksingla/rsscomments.aspx?PostID=2424369</wfw:commentRss><comments>http://blogs.iis.net/ksingla/archive/2008/06/15/genscode-updated-to-help-use-ahadmin-in-c-javascript.aspx#comments</comments><description>As promised in my previous post , I updated genscode tool to provide intellisense for AhAdmin code in C# and JavaScript. GenSCode now accepts an optional codetype switch which can be AhAJavaScript to help use AhAdmin in JavaScript, AhACSharp to help use...(&lt;a href="http://blogs.iis.net/ksingla/archive/2008/06/15/genscode-updated-to-help-use-ahadmin-in-c-javascript.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2424369" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/ksingla/archive/tags/Ahadmin/default.aspx">Ahadmin</category><category domain="http://blogs.iis.net/ksingla/archive/tags/Genscode/default.aspx">Genscode</category><category domain="http://blogs.iis.net/ksingla/archive/tags/MWA/default.aspx">MWA</category></item><item><title>Tool to generate strongly typed classes for configuration sections</title><link>http://blogs.iis.net/ksingla/archive/2006/12/04/tool-to-generate-strongly-typed-classes-for-configuration-sections.aspx</link><pubDate>Mon, 04 Dec 2006 11:46:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1484996</guid><dc:creator>ksingla</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/ksingla/rsscomments.aspx?PostID=1484996</wfw:commentRss><comments>http://blogs.iis.net/ksingla/archive/2006/12/04/tool-to-generate-strongly-typed-classes-for-configuration-sections.aspx#comments</comments><description>&lt;H1 style="MARGIN: auto 0in"&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-weight: bold"&gt;I wrote a simple tool to generate strongly typed classes for IIS configuration sections which can then be used with MWA to enable intellisense. This tool should be able to generate very logical intuitive type names in most cases. Generated code is similar to code samples in my &lt;A class="" href="http://blogs.iis.net/ksingla/archive/2006/12/04/mwa-and-intellisense-for-configuration-sections.aspx" mce_href="http://blogs.iis.net/ksingla/archive/2006/12/04/mwa-and-intellisense-for-configuration-sections.aspx"&gt;earlier&lt;/A&gt; blog.&lt;BR&gt;&lt;BR&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Usage: &lt;BR&gt;genscode.exe &amp;lt;schemaFile&amp;gt; &amp;lt;optional section name&amp;gt;&lt;BR&gt;&lt;/I&gt;&lt;BR&gt;This tool dumps the code on the console. Redirect to save in a file.&lt;BR&gt;&lt;I style="mso-bidi-font-style: normal"&gt;genscode.exe %windir%\system32\inetsrv\config\schema\IIS_Schema.xml system.webServer/httpCompression &amp;gt; HttpCompression.cs&lt;BR&gt;&lt;/I&gt;&lt;BR&gt;Omitting section name will make it generate classes for all sections defined in schema file. &lt;BR&gt;&lt;I style="mso-bidi-font-style: normal"&gt;genscode.exe %windir%\system32\inetsrv\config\schema\IIS_Schema.xml &amp;gt; IISConfigSections.cs&lt;BR&gt;&lt;BR&gt;&lt;/I&gt;Compile the generated code to build a library.&lt;BR&gt;&lt;I style="mso-bidi-font-style: normal"&gt;csc /t:library /r:Microsoft.Web.Administration.dll IISConfigSections.cs&lt;BR&gt;&lt;BR&gt;&lt;/I&gt;Add this library to your project references or just copy-paste the generated code in your code which is using MWA and start editing IIS sections without referring to schema. Here is how adding caching profiles will look like.&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-no-proof: yes; mso-fareast-theme-font: minor-latin"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-no-proof: yes; mso-fareast-theme-font: minor-latin"&gt; SystemwebServer;&lt;BR&gt;&lt;SPAN style="COLOR: teal"&gt;&lt;BR&gt;ServerManager&lt;/SPAN&gt; sm = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;ServerManager&lt;/SPAN&gt;();&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: teal"&gt;CachingSection&lt;/SPAN&gt; cs = (&lt;SPAN style="COLOR: teal"&gt;CachingSection&lt;/SPAN&gt;)sm.GetApplicationHostConfiguration().GetSection(&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;CachingSection&lt;/SPAN&gt;.SectionName,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: teal"&gt;CachingSection&lt;/SPAN&gt;));&lt;BR&gt;cs.Profiles.Add(&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;".htm"&lt;/SPAN&gt;,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;EnumProfilesPolicy&lt;/SPAN&gt;.CacheForTimePeriod,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;EnumProfilesKernelCachePolicy&lt;/SPAN&gt;.CacheForTimePeriod,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;TimeSpan&lt;/SPAN&gt;(1000),&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;EnumProfilesLocation&lt;/SPAN&gt;.Downstream,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;"HEADER"&lt;/SPAN&gt;,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;"QUERYSTRING"&lt;/SPAN&gt;);&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: teal"&gt;ProfilesCollection&lt;/SPAN&gt; profiles = cs.Profiles;&lt;BR&gt;&lt;SPAN style="COLOR: teal"&gt;ProfilesCollectionElement&lt;/SPAN&gt; aspProfile = profiles.CreateElement();&lt;BR&gt;aspProfile.Extension = &lt;SPAN style="COLOR: maroon"&gt;".asp"&lt;/SPAN&gt;;&lt;BR&gt;aspProfile.Policy = &lt;SPAN style="COLOR: teal"&gt;EnumProfilesPolicy&lt;/SPAN&gt;.CacheUntilChange;&lt;BR&gt;profiles.Add(aspProfile);&lt;BR&gt;&lt;BR&gt;sm.CommitChanges();&lt;BR&gt;&lt;/SPAN&gt;&lt;BR&gt;Attached: GenSCodeInstall.zip (containing installer GenSCodeInstall.exe which will install genscode.exe and configschema.dll).&lt;BR&gt;&lt;BR&gt;-Kanwal&lt;/SPAN&gt;&lt;/H1&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1484996" width="1" height="1"&gt;</description><enclosure url="http://blogs.iis.net/ksingla/attachment/1484996.ashx" length="52941" type="application/x-zip-compressed" /><category domain="http://blogs.iis.net/ksingla/archive/tags/Genscode/default.aspx">Genscode</category><category domain="http://blogs.iis.net/ksingla/archive/tags/MWA/default.aspx">MWA</category></item></channel></rss>