<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Tips &amp; Tricks</title>
        <link>http://bchavez.bitarmory.com/category/2.aspx</link>
        <description>Tips and tricks to help improve productivity</description>
        <language>en-US</language>
        <copyright>Brian Chavez</copyright>
        <managingEditor>bchavez@bitarmory.com</managingEditor>
        <generator>Subtext Version 1.9.5.176</generator>
        <item>
            <title>How to Setup a Windows 2008 R2 SNTP/NTP Server</title>
            <link>http://bchavez.bitarmory.com/archive/2009/12/21/how-to-setup-a-windows-2008-r2-sntp-ntp-server.aspx</link>
            <description>&lt;p&gt;&lt;img height="149" align="right" width="144" src="http://kenyonreview.org/blog/wp-content/uploads/2008/12/daylight-savings-time.jpg" alt="" style="display: inline; margin-left: 0px; margin-right: 0px;" /&gt;Gee, setting up an SNTP/NTP server in Windows is &lt;em&gt;&lt;strong&gt;not intuitive&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The good news is: When configured correctly, you can use the Windows Time (W32Time) service as an SNTP/NTP server for both windows and non-windows SNTP/NTP clients.&lt;/p&gt;
&lt;p&gt;Here's how to do it:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Click &lt;strong&gt;Start&lt;/strong&gt;, click &lt;strong&gt;Run&lt;/strong&gt;, type regedit, and then click &lt;strong&gt;OK&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Locate and then click the following registry entry:
    &lt;p&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\&lt;/p&gt;
    &lt;/li&gt;
    &lt;li&gt;In the right pane, right-click &lt;strong&gt;AnnounceFlags&lt;/strong&gt;, and then click &lt;strong&gt;Modify&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;In the &lt;strong&gt;Edit DWORD Value&lt;/strong&gt; dialog box, under &lt;strong&gt;Value data&lt;/strong&gt;, type 5, and then click &lt;strong&gt;OK&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Enable NTPServer.
    &lt;ol&gt;
        &lt;li&gt;Locate and then click the following registry subkey:
        &lt;p align="left"&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\            &lt;br /&gt;
                                                        Services\W32Time\TimeProviders\NtpServer\&lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;In the right pane, right-click &lt;strong&gt;Enabled&lt;/strong&gt;, and then click &lt;strong&gt;Modify&lt;/strong&gt;. &lt;/li&gt;
        &lt;li&gt;In the &lt;strong&gt;Edit DWORD Value&lt;/strong&gt; dialog box, type 1 under &lt;strong&gt;Value data&lt;/strong&gt;, and then click &lt;strong&gt;OK&lt;/strong&gt;. &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Exit Registry Editor. &lt;/li&gt;
    &lt;li&gt;At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:
    &lt;p&gt;&lt;strong&gt;net stop w32time &amp;amp;&amp;amp; net start w32time&lt;/strong&gt;&lt;/p&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This should get you setup with minimal registry hack impact.&lt;/p&gt;
&lt;h3&gt;Tips&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Make sure W32Time is set to Automatic startup mode. &lt;/li&gt;
    &lt;li&gt;Make sure UDP 123 is allowed through your firewall. &lt;/li&gt;
    &lt;li&gt;Use this &lt;strong&gt;InternetTime&lt;/strong&gt; program to help you debug connectivity to your SNTP/NTP server.
    &lt;div class="wlWriterEditableSmartContent" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:c7706d2a-ef85-43b0-886a-785fa17726b8" style="margin: 0px; padding: 0px; display: inline; float: none;"&gt;
    &lt;div&gt;&lt;a target="_self" href="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/HowtoSetupaWindows2008R2SNTPNTPServer_1E4/internettime_1.zip"&gt;internettime.zip&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Hope that helps,&lt;br /&gt;
Brian Chavez&lt;img src="http://bchavez.bitarmory.com/aggbug/75.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2009/12/21/how-to-setup-a-windows-2008-r2-sntp-ntp-server.aspx</guid>
            <pubDate>Mon, 21 Dec 2009 08:06:52 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/75.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2009/12/21/how-to-setup-a-windows-2008-r2-sntp-ntp-server.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/75.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/75.aspx</trackback:ping>
        </item>
        <item>
            <title>Upgrading SubText, IIS7, Windows 2008</title>
            <link>http://bchavez.bitarmory.com/archive/2009/01/13/upgrading-subtext-iis7-windows-2008.aspx</link>
            <description>&lt;p&gt;&lt;img height="95" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/UpgradingSubTextIIS7Windows2008_1070A/image_46a54e17-0dd3-487e-a708-5dac70f3532a.png" width="187" align="right" border="0" /&gt; Bit Armory, Inc. has decided to finally make the move to IIS7 for production.  Let's hope it goes well.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;First Impressions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Performance seems a little better&lt;/li&gt;    &lt;li&gt;Better ASP.NET MVC support&lt;/li&gt;    &lt;li&gt;Easier Setup&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I did have a problem with Subtext and IIS 7 yelping back an error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;"System.Web.HttpException: Request is not available in this context"&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Thanks to &lt;a href="http://www.anewdevelopment.com/2008/01/installing-subtext-on-vista-request-is.html"&gt;Lance Fisher&lt;/a&gt;, the fix was easy, simply set "Classic .NET AppPool" in Manage Web Site &amp;gt; Advanced Settings ... should do the trick.&lt;/p&gt;  &lt;p&gt;&lt;img height="291" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/UpgradingSubTextIIS7Windows2008_1070A/image_59ba07e1-ae23-4ca6-bc04-116891d05008.png" width="430" border="0" /&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Hope that helps!&lt;/p&gt;  &lt;p&gt;Brian Chavez&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/70.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2009/01/13/upgrading-subtext-iis7-windows-2008.aspx</guid>
            <pubDate>Wed, 14 Jan 2009 02:42:41 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/70.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2009/01/13/upgrading-subtext-iis7-windows-2008.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/70.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/70.aspx</trackback:ping>
        </item>
        <item>
            <title>Enterprise Library Validation MessageTemplate Tokens</title>
            <link>http://bchavez.bitarmory.com/archive/2008/08/28/enterprise-library-validation-messagetemplate-tokens.aspx</link>
            <description>&lt;p&gt;I always forget... pulled from MSDN with my notes added in italics:&lt;/p&gt; &lt;form id="aspnetForm" name="aspnetForm" action="http://msdn.microsoft.com/cc511900.aspx" method="post"&gt;   &lt;div id="contents"&gt;     &lt;div class="resizableArea" id="ctl00_rs1_ra1" style="height: 656px"&gt;       &lt;div class="rightSection" id="ctl00_rs1_raRight"&gt;         &lt;div class="RightPanel"&gt;           &lt;div class="ContentArea"&gt;             &lt;div class="topic"&gt;               &lt;div id="mainSection"&gt;                 &lt;div id="mainBody"&gt;                   &lt;div class="MTPS_CollapsibleRegion" id="ctl00_rs1_mainContentContainer_cpe46147" xmlns:msxsl="urn:schemas-microsoft-com:xslt"&gt;                     &lt;h3&gt;Understanding Message Template Tokens&lt;/h3&gt;                      &lt;div class="MTPS_CollapsibleSection" id="ctl00_rs1_mainContentContainer_cpe46147_c" style="display: block; overflow: visible; width: auto; height: auto"&gt;                       &lt;div class="MTPS_CollapsibleSection" id="" style="border-right: medium none; border-top: medium none; display: block; border-left: medium none; border-bottom: medium none"&gt;&lt;a name="sectionToggle2"&gt;&lt;/a&gt;                          &lt;p&gt;Custom message templates can contain tokens. The validator replaces these tokens with values before it adds the resulting message to an instance of the &lt;b&gt;ValidationResult&lt;/b&gt; class. Tokens are represented by using the strings {0}, {1}, {2}, and so on within the message template strings. All validators provided by the Validation Application Block use the first three tokens {0}, {1}, and {2} for the same purposes. Different validators may also understand additional tokens, beginning with {3}. The following table describes tokens {0}, {1}, and {2}. &lt;/p&gt;                          &lt;table&gt;&lt;tbody&gt;                             &lt;tr valign="top"&gt;                               &lt;th&gt;                                 &lt;p&gt;Token&lt;/p&gt;                               &lt;/th&gt;                                &lt;th&gt;                                 &lt;p&gt;Description&lt;/p&gt;                               &lt;/th&gt;                             &lt;/tr&gt;                              &lt;tr valign="top"&gt;                               &lt;td&gt;                                 &lt;p&gt;&lt;b&gt;{0}&lt;/b&gt;&lt;/p&gt;                               &lt;/td&gt;                                &lt;td&gt;                                 &lt;p&gt;This token represents the value of the object that is being validated. Although it can be useful to show the original value as a part of the validation message, you must be careful to avoid injection attacks by escaping any characters that can be used to attack the system that conveys the message to the user.&lt;/p&gt;                                  &lt;h4&gt;&lt;em&gt;In simple terms: returns "ObjectBeingValidatedFullTypeName+Field"&lt;/em&gt;&lt;/h4&gt;                               &lt;/td&gt;                             &lt;/tr&gt;                              &lt;tr valign="top"&gt;                               &lt;td&gt;                                 &lt;p&gt;&lt;b&gt;{1}&lt;/b&gt;&lt;/p&gt;                               &lt;/td&gt;                                &lt;td&gt;                                 &lt;p&gt;This token represents the key of the object that is being validated. When the validator is attached to a member of a type such as a property or a field, the key is set to the member name. When the validator is attached to an object, the key is null and the token is replaced by an empty string.&lt;/p&gt;                                  &lt;h4&gt;&lt;em&gt;In simple terms: returns "Field" name being validated&lt;/em&gt;&lt;/h4&gt;                               &lt;/td&gt;                             &lt;/tr&gt;                              &lt;tr valign="top"&gt;                               &lt;td&gt;                                 &lt;p&gt;&lt;b&gt;{2}&lt;/b&gt;&lt;/p&gt;                               &lt;/td&gt;                                &lt;td&gt;                                 &lt;p&gt;This token represents the tag that is specified on the validator instance. If no tag is supplied, the token is replaced by an empty string.&lt;/p&gt;                                  &lt;h4&gt;&lt;em&gt;In simple terms: returns contents of [Validator Tag="foo"] property defined in the attribute.&lt;/em&gt;&lt;/h4&gt;                               &lt;/td&gt;                             &lt;/tr&gt;                           &lt;/tbody&gt;&lt;/table&gt;                       &lt;/div&gt;                     &lt;/div&gt;                   &lt;/div&gt;                 &lt;/div&gt;               &lt;/div&gt;             &lt;/div&gt;           &lt;/div&gt;         &lt;/div&gt;       &lt;/div&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/form&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/67.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/08/28/enterprise-library-validation-messagetemplate-tokens.aspx</guid>
            <pubDate>Thu, 28 Aug 2008 23:48:13 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/67.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/08/28/enterprise-library-validation-messagetemplate-tokens.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/67.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/67.aspx</trackback:ping>
        </item>
        <item>
            <title>Fluent C Sharp Language Extension Helpers - Part 1</title>
            <link>http://bchavez.bitarmory.com/archive/2008/08/28/fluent-c-sharp-language-extension-helpers---part-1.aspx</link>
            <description>&lt;p&gt;So, I found myself doing a lot of &lt;strong&gt;for( int i = 0; i &amp;lt; n; i++ ){}&lt;/strong&gt; stuff lately.  So, I've decided to try something new. I've started a small collection of "Fluent Helpers" that alleviate a lot of the verbosity in C#.&lt;/p&gt;  &lt;p&gt;About &lt;strong&gt;28 characters&lt;/strong&gt; (including spaces) for a simple for loop to do some constant iteration.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;for( int i = 0; i &amp;lt; n, i++){&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;About &lt;strong&gt;18 characters&lt;/strong&gt; to do this (no pun intended):&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Do.This( 5, () =&amp;gt;{&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here's an example:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   51&lt;/span&gt;             &lt;span style="color: #9ea6da"&gt;Do&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;This( &lt;span style="font-weight: bold; color: #8fced1"&gt;5&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   52&lt;/span&gt;                     () &lt;span style="color: #c9b68f"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   53&lt;/span&gt;                         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   54&lt;/span&gt;                             &lt;span style="color: #9ea6da"&gt;Console&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Write( &lt;span style="color: #b8ced3"&gt;"Hello "&lt;/span&gt; );&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   55&lt;/span&gt;                             &lt;span style="color: #9ea6da"&gt;Console&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;WriteLine( &lt;span style="color: #b8ced3"&gt;"World!"&lt;/span&gt; );&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   56&lt;/span&gt;                         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   57&lt;/span&gt;                 );&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Prints:&lt;/p&gt;  &lt;p&gt;Hello World!   &lt;br /&gt;Hello World!    &lt;br /&gt;Hello World!    &lt;br /&gt;Hello World!    &lt;br /&gt;Hello World!&lt;/p&gt;  &lt;p&gt;Now that &lt;em&gt;&lt;strong&gt;feels&lt;/strong&gt;&lt;/em&gt; much better on my hands, and looks much cleaner too, IMHO.  Here's the simple implementation for &lt;strong&gt;Do.This&lt;/strong&gt;:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   42&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;static&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;Do&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   43&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   44&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;static&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;void&lt;/span&gt; This(&lt;span style="font-weight: bold; color: #5b8a86"&gt;int&lt;/span&gt; times, &lt;span style="color: #2b91af"&gt;Action&lt;/span&gt; what)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   45&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   46&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;for&lt;/span&gt;( &lt;span style="font-weight: bold; color: #5b8a86"&gt;int&lt;/span&gt; i &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold; color: #8fced1"&gt;0&lt;/span&gt;; i &lt;span style="color: #c9b68f"&gt;&amp;lt;&lt;/span&gt; times; i&lt;span style="color: #c9b68f"&gt;++&lt;/span&gt; )&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   47&lt;/span&gt;             {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   48&lt;/span&gt;                 what();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   49&lt;/span&gt;             }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   50&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;   51&lt;/span&gt;     }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;I've already started a little library of these small syntax helpers I've collected.  If you have any suggestions, please share! &lt;img alt="cool0003.gif" src="http://bchavez.bitarmory.com/Images/emotions/cool0003.gif" /&gt;&lt;/p&gt;  &lt;p&gt;-Brian Chavez&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/66.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/08/28/fluent-c-sharp-language-extension-helpers---part-1.aspx</guid>
            <pubDate>Thu, 28 Aug 2008 23:08:47 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/66.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/08/28/fluent-c-sharp-language-extension-helpers---part-1.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/66.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/66.aspx</trackback:ping>
        </item>
        <item>
            <title>Understanding ScriptResource and WebResource in ASP.NET</title>
            <link>http://bchavez.bitarmory.com/archive/2008/07/28/understanding-scriptresource-and-webresource-in-asp.net.aspx</link>
            <description>&lt;p&gt;Here are some common questions about ASP.NET and web resources:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;What is a web resource? &lt;/li&gt;    &lt;li&gt;How do I get my embedded scripts to be delivered by ScriptResource.axd handler? &lt;/li&gt;    &lt;li&gt;How do I get my embedded scripts to be delivered by WebResource.axd handler? &lt;/li&gt;    &lt;li&gt;What is the difference between ScriptResource.axd and WebResource.axd? &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;First, let's tackle the first question.  What is a web resource and why would you use such a thing?&lt;/p&gt;  &lt;h2&gt;Web Resources&lt;/h2&gt;  &lt;p&gt;A web resource is a file embedded in an assembly.  This file can either be a JavaScript file or a BMP, or any other emendable type of resource in an assembly.  Just take a look at &lt;strong&gt;System.Web&lt;/strong&gt; and all the embedded resources that are defined:&lt;/p&gt;  &lt;p&gt;&lt;img height="290" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/UnderstandingScriptResourceandWebRes.NET_3AEA/image_e03979ef-8357-4a4e-9163-c2e4bcad15fe.png" width="651" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;You'll notice there are both, Images and Scripts.  There's even some html!  So, web resources (at an assembly level) can be composed of just about anything you want.&lt;/p&gt;  &lt;h2&gt;How do you define Web Resources? &lt;/h2&gt;  &lt;p&gt;Meet the &lt;strong&gt;[WebResource]&lt;/strong&gt; attribute.  You define web resources by using the &lt;strong&gt;WebResource&lt;/strong&gt; attribute.  The &lt;strong&gt;WebResourceAttribute&lt;/strong&gt; acts as an access marker to allow resource handlers to find your resources.  The first parameter to &lt;strong&gt;WebResource&lt;/strong&gt; is the name of the web resource, the second parameter is the &lt;strong&gt;ContentType&lt;/strong&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;[WebResource&lt;/strong&gt;(       &lt;br /&gt;  &lt;em&gt;webResourceName&lt;/em&gt;       &lt;br /&gt;    Type: System.String       &lt;br /&gt;    The name of the of Web resource.       &lt;br /&gt;,       &lt;br /&gt;  &lt;em&gt;contentType&lt;/em&gt;       &lt;br /&gt;    Type: System.String       &lt;br /&gt;    The type of resource, such as "image/gif" or "text/javascript".       &lt;br /&gt;)&lt;strong&gt;]&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;img height="120" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/UnderstandingScriptResourceandWebRes.NET_3AEA/image_a88d8e20-9d5d-4b74-ad41-c890bb987b4a.png" width="226" align="right" border="0" /&gt; Once you have your [&lt;strong&gt;WebResource&lt;/strong&gt;] defined in your assembly, the next step is to mark the file you want embedded as an "&lt;strong&gt;Embedded Resource&lt;/strong&gt;" in Visual Studio.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt; &lt;/h2&gt;  &lt;h2&gt; &lt;/h2&gt;  &lt;h2&gt;Working with Assembly Resources&lt;/h2&gt;  &lt;p&gt;There are two basic ways to getting at your assembly resources loaded on your ASP.NET web page.  &lt;strong&gt;ScriptResource.axd&lt;/strong&gt; and &lt;strong&gt;WebResource.axd&lt;/strong&gt;.&lt;/p&gt;  &lt;h3&gt;Using WebResource.axd&lt;/h3&gt;  &lt;p&gt;Generally, you'll want to use WebResource.axd when you are dealing with binary resources.  Things like emendable images or other types of media.  You can use WebResource for serving out JavaScript files but there is a better alternative.  However, if you're stuck in ASP.NET 2.0 land with out Microsoft AJAX, then &lt;strong&gt;WebResource.axd&lt;/strong&gt; is your only option to serve out your embedded assembly resources.  To make your assembly resources available on your ASP.NET page, simply use:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  104&lt;/span&gt;  &lt;span style="color: #7a987a"&gt;//Uses WebResource.axd&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  105&lt;/span&gt;  &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Page&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;ClientScript&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;RegisterClientScriptResource( &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  106&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;typeof&lt;/span&gt;(&lt;span style="color: #9ea6da"&gt;SwfObject&lt;/span&gt;), &lt;span style="color: #b8ced3"&gt;"ProjectBase.Web.Scripts.swfobject.js"&lt;/span&gt; );&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  107&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  108&lt;/span&gt;  &lt;span style="font-weight: bold; color: #5b8a86"&gt;string&lt;/span&gt; urlToFunnyWebResourceUrl &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  109&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Page&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;ClientScript&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;GetWebResourceUrl(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  110&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;typeof&lt;/span&gt;(&lt;span style="color: #9ea6da"&gt;SwfObject&lt;/span&gt;), &lt;span style="color: #b8ced3"&gt;"ProjectBase.Web.Images.Header.gif"&lt;/span&gt; );&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;strong&gt;urlToFunnyWebResourceUrl&lt;/strong&gt; is the the actual absolute path to your webresource.  So you could potentially use it to link to an image or script.  &lt;strong&gt;ClientScript.Register*&lt;/strong&gt; are generally reserved for loading JavaScript.  It's pretty straight forward, pass in the &lt;strong&gt;typeof(Control)&lt;/strong&gt; that's requesting the resource, and the full name to the assembly resource.  The result of these calls will generate URLs to &lt;strong&gt;WebResource.axd&lt;/strong&gt;.&lt;/p&gt;  &lt;h3&gt;Using ScriptResource.axd&lt;/h3&gt;  &lt;p&gt;As I mentioned earlier, there is a better alternative for loading your JavaScript assets if you're working with ASP.NET AJAX.  Using ScriptResource.axd handler actually has some interesting features.  Some features include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Automatically GZip/Compressing your scripts over HTTP for delivery. &lt;/li&gt;    &lt;li&gt;Dynamically resolving Release/Debug scripts based on build parameters.  This is useful, if you keep two types of the same script: one for debug, and one packed for release. &lt;/li&gt;    &lt;li&gt;Can be used for Non-MsAJAX Framework script assets such as jQuery. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The &lt;strong&gt;ScriptManager&lt;/strong&gt; object is how we can get our embedded JavaScript into our page using &lt;strong&gt;ScriptResource.axd&lt;/strong&gt;:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  112&lt;/span&gt;  &lt;span style="color: #7a987a"&gt;//Uses ScriptManager.axd&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  113&lt;/span&gt;  &lt;span style="color: #9ea6da"&gt;ScriptManager&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;RegisterClientScriptResource(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  114&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;, &lt;span style="font-weight: bold; color: #5b8a86"&gt;typeof&lt;/span&gt;(&lt;span style="color: #9ea6da"&gt;SwfObject&lt;/span&gt;), &lt;span style="color: #b8ced3"&gt;"ProjectBase.Web.Scripts.swfobject.js"&lt;/span&gt; );&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The calling semantics are pretty much the same as the previous calls to WebResource.axd, the only difference is that we are passing in &lt;strong&gt;this&lt;/strong&gt; instance of the control that wants to register the script.  The effect of calling this method results in scripts being loaded from &lt;strong&gt;ScriptResource.axd&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;That's it!  Happy coding!  I'll probably add some more tips on this post if I come across any.&lt;/p&gt;  &lt;p&gt;Brian Chavez&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/62.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/07/28/understanding-scriptresource-and-webresource-in-asp.net.aspx</guid>
            <pubDate>Mon, 28 Jul 2008 11:11:56 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/62.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/07/28/understanding-scriptresource-and-webresource-in-asp.net.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/62.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/62.aspx</trackback:ping>
        </item>
        <item>
            <title>The ParseChildren PersistChildren and PersistenceMode.InnerProperty</title>
            <link>http://bchavez.bitarmory.com/archive/2008/07/27/parsechildren-persistchildren-persistencemode.innerproperty.aspx</link>
            <description>&lt;p&gt;After a while of non-web control development, &lt;strong&gt;ParseChildren&lt;/strong&gt; and &lt;strong&gt;PersistChildren&lt;/strong&gt; attributes are important attributes to remember when trying to get the desired results your looking for in the Visual Studio designer.&lt;/p&gt;  &lt;p&gt;So, this post should clear up (and serve as a reminder for me) how and why these attributes are important.  Let's explore what these two attributes are used for.  Let's start with &lt;strong&gt;ParseChildren&lt;/strong&gt;.&lt;/p&gt;  &lt;h2 align="center"&gt;The &lt;strong&gt;&lt;font face="Courier New"&gt;[ParseChildrenAttribute]&lt;/font&gt;&lt;/strong&gt;&lt;/h2&gt;  &lt;p&gt;The &lt;strong&gt;ParseChildren&lt;/strong&gt; Attribute is probably, the most important attribute you should pay attention to when developing web controls.  It's actually used by the ASP.NET Parser and &lt;strong&gt;ControlBuilder&lt;/strong&gt; object to figure out how to parse the ASP.NET code you write.  Visual Studio also uses this attribute to figure out what valid sub-controls and components are allowed within the contents of a server control.&lt;/p&gt;  &lt;p&gt;Let's say, I want to create an &lt;strong&gt;AggregateFeeds&lt;/strong&gt; control that displays an aggregate list of RSS feeds.&lt;/p&gt;  &lt;h2&gt;A Basic and Boring Control Syntax&lt;/h2&gt;  &lt;h4&gt;&lt;strong&gt;&lt;img height="126" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/ParseChildrenPersistChildr.InnerProperty_14EFD/image_14210353-b7f5-4317-962a-bc34a4c27414.png" width="455" border="0" /&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;You'll notice that the &lt;strong&gt;RssResource&lt;/strong&gt; is the only available option that is allowed as a child from the &lt;strong&gt;AggregateFeeds&lt;/strong&gt; control.  Here's the code behind the &lt;strong&gt;AggregateFeeds&lt;/strong&gt; control:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  113&lt;/span&gt;     [&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  114&lt;/span&gt;     &lt;span style="color: #9ea6da"&gt;ParseChildren&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  115&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;typeof&lt;/span&gt;(&lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;),&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  116&lt;/span&gt;         DefaultProperty &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="color: #b8ced3"&gt;"Feeds"&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  117&lt;/span&gt;         ChildrenAsProperties &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;true&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  118&lt;/span&gt;         )&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  119&lt;/span&gt;     ]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  120&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;AggregateFeeds&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;Control&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  121&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  122&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; AggregateFeeds()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  123&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  124&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Feeds &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;new&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  125&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  126&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt; Feeds&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  127&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  128&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  129&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;private&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  130&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  131&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;protected&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;override&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;void&lt;/span&gt; Render(&lt;span style="color: #9ea6da"&gt;HtmlTextWriter&lt;/span&gt; writer)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  132&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  133&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Feeds&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  134&lt;/span&gt;                 &lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;ForEach( rssRes &lt;span style="color: #c9b68f"&gt;=&amp;gt;&lt;/span&gt; writer&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Write( rssRes&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Url ) );&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  135&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  136&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  137&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  138&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;List&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  139&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  140&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  141&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  142&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  143&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  144&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  145&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;string&lt;/span&gt; Url { &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  146&lt;/span&gt;     }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The &lt;strong&gt;ParseChildren&lt;/strong&gt; attribute on &lt;strong&gt;AggregateFeeds&lt;/strong&gt; tells the ASP.NET, that any children within the &lt;strong&gt;AggregateFeeds&lt;/strong&gt; control should be &lt;strong&gt;typeof(RssResource)&lt;/strong&gt;.  &lt;strong&gt;ChildrenAsProperties=true&lt;/strong&gt; let's ASP.NET know that it should STOP parsing server controls with "runat=server", and switch to instantiating objects into the properties of the &lt;strong&gt;ArggregateFeeds&lt;/strong&gt; control.  &lt;strong&gt;DefaultProperty&lt;/strong&gt; says, that the results of the parsed objects should go into the default property &lt;strong&gt;Feeds&lt;/strong&gt;.&lt;/p&gt;  &lt;h2&gt;Syntax Goodness With InnerProperty&lt;/h2&gt;  &lt;p&gt;The previous example was great, it's simple and get's the job done.  But let's say, the requirements have changed, our control is growing, and we need to allow more customization, and extensibility for the consumers of our &lt;strong&gt;AggregateFeeds&lt;/strong&gt; control.&lt;/p&gt;  &lt;p&gt;Let's clean up the markup and allow our developers to create markup like this: &lt;/p&gt;  &lt;p&gt;&lt;img height="174" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/ParseChildrenPersistChildr.InnerProperty_14EFD/image_95a7c170-dbd2-4ad8-bd89-7e7b13006914.png" width="486" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;To get this type of syntactical behavior, check out the code below:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  113&lt;/span&gt;     [&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  114&lt;/span&gt;     &lt;span style="color: #9ea6da"&gt;ParseChildren&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  115&lt;/span&gt;         ChildrenAsProperties &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;true&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  116&lt;/span&gt;         )&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  117&lt;/span&gt;     ]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  118&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;AggregateFeeds&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;Control&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  119&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  120&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; AggregateFeeds()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  121&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  122&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Feeds &lt;span style="color: #c9b68f"&gt;=&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;new&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  123&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  124&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  125&lt;/span&gt;         [&lt;span style="color: #9ea6da"&gt;PersistenceMode&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;PersistenceMode&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;InnerProperty)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  126&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt; Feeds&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  127&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  128&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  129&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;private&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  130&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  131&lt;/span&gt;         [&lt;span style="color: #9ea6da"&gt;PersistenceMode&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;PersistenceMode&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;InnerProperty)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  132&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;AggregateSettings&lt;/span&gt; Settings&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  133&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  134&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  135&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;private&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  136&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  137&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;protected&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;override&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;void&lt;/span&gt; Render(&lt;span style="color: #9ea6da"&gt;HtmlTextWriter&lt;/span&gt; writer)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  138&lt;/span&gt;         {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  139&lt;/span&gt;             &lt;span style="font-weight: bold; color: #5b8a86"&gt;this&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Feeds&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  140&lt;/span&gt;                 &lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;ForEach( rssRes &lt;span style="color: #c9b68f"&gt;=&amp;gt;&lt;/span&gt; writer&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Write( rssRes&lt;span style="color: #c9b68f"&gt;.&lt;/span&gt;Url ) );&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  141&lt;/span&gt;         }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  142&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  143&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  144&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  145&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;AggregateSettings&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  146&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  147&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;int&lt;/span&gt; TimeOut { &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  148&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;bool&lt;/span&gt; CacheResults { &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  149&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  150&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  151&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssFeedCollection&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;List&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;span style="color: #c9b68f"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  152&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  153&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  154&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  155&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  156&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  157&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  158&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;string&lt;/span&gt; Url { &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  159&lt;/span&gt;     }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Notice, we've removed &lt;strong&gt;DefaultProperty&lt;/strong&gt; and &lt;strong&gt;typeof(RssResource)&lt;/strong&gt; from &lt;strong&gt;ParseChildren&lt;/strong&gt; attribute.  We're no longer working with a simple control that has simple children objects that need to be parsed, we're now working with a complex control with more than one property that we're setting in the markup, so we've removed the "default" stuff.  The syntactical magic happens with &lt;strong&gt;PersitanceMode&lt;/strong&gt; attribute on the properties.  &lt;strong&gt;PersistanceMode.InnerProperty&lt;/strong&gt; allows us to specify our cool &lt;strong&gt;&amp;lt;Feeds&amp;gt;&lt;/strong&gt; and &lt;strong&gt;&amp;lt;Settings&amp;gt;&lt;/strong&gt; tags.  How does Visual Studio know what members are available?  It does so by Reflection.&lt;/p&gt;  &lt;h2&gt;Get fancy, more than one child type&lt;/h2&gt;  &lt;p&gt;Also, I want to point out, suppose, we want to support multiple types of Feed objects.  We could use an &lt;strong&gt;enum&lt;/strong&gt; in &lt;strong&gt;RssResource&lt;/strong&gt;, or &lt;em&gt;&lt;strong&gt;we could use inheritance&lt;/strong&gt;&lt;/em&gt; to achieve the following: &lt;/p&gt;  &lt;p&gt;&lt;img height="172" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/ParseChildrenPersistChildr.InnerProperty_14EFD/image_f6b0cfb2-991f-4694-9c26-c6aeb665c665.png" width="485" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;All we would have to do is simply mark &lt;strong&gt;RssResource&lt;/strong&gt; as an abstract class. Then, subclass for each type.&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #313132; color: #dfdfc0; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  156&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;abstract&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  157&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  158&lt;/span&gt;         &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;string&lt;/span&gt; Url { &lt;span style="font-weight: bold; color: #5b8a86"&gt;get&lt;/span&gt;; &lt;span style="font-weight: bold; color: #5b8a86"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  159&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  160&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;MediaRss&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  161&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  162&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  163&lt;/span&gt;     }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  164&lt;/span&gt;     &lt;span style="font-weight: bold; color: #5b8a86"&gt;public&lt;/span&gt; &lt;span style="font-weight: bold; color: #5b8a86"&gt;class&lt;/span&gt; &lt;span style="color: #9ea6da"&gt;ITunesRss&lt;/span&gt; : &lt;span style="color: #9ea6da"&gt;RssResource&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  165&lt;/span&gt;     {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  166&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #eaaf00"&gt;  167&lt;/span&gt;     }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Again, I'm just showing that it's possible, but following my mantra of "less code, less maintenance," I'd use an enum to describe the type of rss feed on &lt;strong&gt;RssResource&lt;/strong&gt;.&lt;/p&gt;  &lt;h2&gt;Where is [PersistChildren]?&lt;/h2&gt;  &lt;p&gt;Nowhere!  Is &lt;strong&gt;PersistChildren&lt;/strong&gt; attribute needed?  No, it's not a required attribute to create your custom control.  The &lt;strong&gt;PersistChildrenAttribute&lt;/strong&gt; only provides designer support for your control with Visual Studio and has no "processing" affect in ASP.NET, but remember &lt;strong&gt;&lt;em&gt;&lt;font color="#008080"&gt;Parse&lt;/font&gt;Children&lt;/em&gt;&lt;/strong&gt; does.&lt;/p&gt;  &lt;p&gt;I'm a &lt;img height="23" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/ParseChildrenPersistChildr.InnerProperty_14EFD/image_9ebafac6-76b0-47f7-b53a-444b371858c6.png" width="189" border="0" /&gt;  source-view only guy.  I really don't remember the last time I've used the Visual Studio "Design View", it's a waste, crashes all the time, so I've pretty much given up on it.  Besides, "Design View" is for n00bs anyway.  Just kidding!  If you plan on using the Design View, then you'll probably need your &lt;strong&gt;PersistChildren&lt;/strong&gt; attribute...&lt;/p&gt;  &lt;p&gt;In general, &lt;strong&gt;PersistChildren&lt;/strong&gt; and &lt;strong&gt;ParseChildren&lt;/strong&gt; are exclusive complementary attributes to describe the same semantic operation.  The rule of thumb goes:&lt;/p&gt;  &lt;p&gt;If &lt;strong&gt;&lt;em&gt;&lt;font color="#008080"&gt;Parse&lt;/font&gt;&lt;/em&gt;Children(&lt;font color="#008040"&gt;true&lt;/font&gt;)&lt;/strong&gt;, then &lt;strong&gt;&lt;em&gt;&lt;font color="#008080"&gt;Persist&lt;/font&gt;&lt;/em&gt;Children(&lt;font color="#ff0000"&gt;false&lt;/font&gt;)&lt;/strong&gt;.  &lt;/p&gt;  &lt;p&gt;If&lt;em&gt; &lt;/em&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#008080"&gt;Parse&lt;/font&gt;&lt;/em&gt;Children(&lt;font color="#ff0000"&gt;false&lt;/font&gt;)&lt;/strong&gt;, then &lt;strong&gt;&lt;em&gt;&lt;font color="#008080"&gt;Persist&lt;/font&gt;&lt;/em&gt;Children(&lt;font color="#008000"&gt;true&lt;/font&gt;)&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Following the &lt;strong&gt;PersistChildren&lt;/strong&gt; guideline above should keep your code out of trouble.  But again, I wouldn't use &lt;strong&gt;PersistChildren&lt;/strong&gt; only until you actually need it.  Less code, less maintenance.&lt;/p&gt;  &lt;p&gt;Here's a nice list of attributes you should consider when writing your custom controls:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://wdevs.blogspot.com/2007/10/attributes-to-consider-applying-when.html" href="http://wdevs.blogspot.com/2007/10/attributes-to-consider-applying-when.html"&gt;http://wdevs.blogspot.com/2007/10/attributes-to-consider-applying-when.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope that helps! Happy coding!&lt;/p&gt;  &lt;p&gt;Brian Chavez&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/61.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/07/27/parsechildren-persistchildren-persistencemode.innerproperty.aspx</guid>
            <pubDate>Mon, 28 Jul 2008 06:49:49 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/61.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/07/27/parsechildren-persistchildren-persistencemode.innerproperty.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/61.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/61.aspx</trackback:ping>
        </item>
        <item>
            <title>NAnt Addin for Visual Studio (VS) 2008</title>
            <link>http://bchavez.bitarmory.com/archive/2008/07/13/nant-addin-for-visual-studio-vs-2008.aspx</link>
            <description>&lt;p&gt;&lt;img width="186" height="324" border="0" align="right" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/NAntAddinforVisualStudioVS2008_F7E7/image_68eb9b4e-04a6-4eb4-80f3-db67dd4288ab.png" alt="image" /&gt; I've finally committed and upgraded VS 2008.  Fortunately, everything has gone pretty smooth.  Third party tooling support for VS 2008 is now reasonable, ReSharper, Code Rush, all now are supporting 2008.  But one of my favorite helper tools is &lt;a href="http://www.netlogics.ch/en/nantaddin.html"&gt;NAntAddin developed by Netlogics Software&lt;/a&gt;.  It's quick and easy to execute specific NAnt tasks in the window.  Unfortunately, it doesn't support 2008 out of the box.&lt;/p&gt;
&lt;p&gt;However, after playing around with the AddIn file, I was able to get NAntAddin working with VS 2008.&lt;/p&gt;
&lt;p&gt;Here's how to do it:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;a href="http://www.netlogics.ch/devcenter/addins.nant.html"&gt;Download&lt;/a&gt; the latest version. &lt;/li&gt;
    &lt;li&gt;Unzip and copy the addin files and folder to:      &lt;br /&gt;
    &lt;br /&gt;
    On Vista:      &lt;br /&gt;
    &lt;strong&gt;\Users\%UserName%\Visual Studio 2008\Addins&lt;/strong&gt;       &lt;br /&gt;
    &lt;br /&gt;
    On XP:      &lt;br /&gt;
    &lt;strong&gt;\My Documents\Visual Studio 2008\Addins&lt;/strong&gt;      &lt;br /&gt;
    &lt;br /&gt;
    Note: If you don't see an "Addins" folder in, then create one under "Visual Studio 2008".      &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Next, open the NAntAddin.Addin file with your favorite text editor, and edit the &amp;lt;version&amp;gt; value to 9.0 as shown below:      &lt;br /&gt;
    &lt;br /&gt;
    &lt;img width="353" height="208" border="0" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/NAntAddinforVisualStudioVS2008_F7E7/image_0a4d1fe1-82f1-43d5-a787-9976dc072530.png" alt="image" /&gt;  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now start Visual Studio 2008, and you should have NAntAddin up and running!&lt;/p&gt;
&lt;p&gt;Your final directory structure should look like the following:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img width="402" height="304" border="0" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/NAntAddinforVisualStudioVS2008_F7E7/image_c4a7792e-3d9e-4303-b920-1e1f3e81adcc.png" alt="image" /&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Happy coding!&lt;/p&gt;
&lt;p&gt;Brian Chavez&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/58.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/07/13/nant-addin-for-visual-studio-vs-2008.aspx</guid>
            <pubDate>Mon, 14 Jul 2008 00:39:12 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/58.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/07/13/nant-addin-for-visual-studio-vs-2008.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/58.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/58.aspx</trackback:ping>
        </item>
        <item>
            <title>BadImageFormatException Errors</title>
            <link>http://bchavez.bitarmory.com/archive/2008/04/29/badimageformatexception-errors.aspx</link>
            <description>&lt;p&gt;I've been playing with &lt;a href="http://www.lua.org/"&gt;Lua Programming/Script Language&lt;/a&gt; and &lt;a href="http://luaforge.net/projects/luainterface/"&gt;LuaInterface&lt;/a&gt;, because I have a need for embedding a scripting language in one of our projects.  Unfortunately, when trying to run one of the test case applications that came with LuaInterface, I was presented with a nice error shown below:&lt;/p&gt;  &lt;p&gt;&lt;img height="102" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/BadImageFormatExceptionErrors_F43C/image_52782f68-5e5d-4634-b3ec-4776d39162a8.png" width="649" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Anytime, you run a .NET application, the operating system reads the PE header information of the executable to help setup the process environment.  In my case, &lt;strong&gt;TestLua.exe&lt;/strong&gt; was being setup and ran in x64 mode with an x64 runtime and failed to P/Invoke Lua's native 32-bit DLL.&lt;/p&gt;  &lt;h3&gt;Solution&lt;/h3&gt;  &lt;p&gt;In general, there are two main ways we can explicitly tell the operating system to load and use 32-bit process environments:&lt;/p&gt;  &lt;p&gt;For applications and assemblies that you &lt;strong&gt;can not&lt;/strong&gt; recompile:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Set the 32-Bit flag in the PE header.  &lt;br /&gt;      &lt;br /&gt;For example, since the 32-bit flag in &lt;strong&gt;TestLua.exe&lt;/strong&gt; was not set, I forced 32-bit mode by setting the 32-bit flag using &lt;strong&gt;CorFlags.exe&lt;/strong&gt;:      &lt;br /&gt;      &lt;br /&gt;Start "Visual Studio SDK Command Prompt" and execute:      &lt;br /&gt;&lt;strong&gt;CorFlags.exe /32bit+ TestLua.exe&lt;/strong&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For applications and assemblies that you &lt;strong&gt;can&lt;/strong&gt; recompile:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Recompile using the "Target Platform" settings as illustrated &lt;a href="http://www.atalasoft.com/kb/article.aspx?id=10165"&gt;here&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In practice, if you do low-level COM, P/Invoke, Win32 stuff, you'll probably need to set these 32-bit flags for your applications; however, if your application purely lives in the managed world, you won't need to do anything!&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/53.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/04/29/badimageformatexception-errors.aspx</guid>
            <pubDate>Wed, 30 Apr 2008 00:22:22 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/53.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/04/29/badimageformatexception-errors.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/53.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/53.aspx</trackback:ping>
        </item>
        <item>
            <title>Vista Explorer Annoyances and Enhancements</title>
            <link>http://bchavez.bitarmory.com/archive/2008/02/13/vista-explorer-annoyances-and-enhancements.aspx</link>
            <description>&lt;p&gt;&lt;img style="margin: 0px 0px 0px 20px" height="82" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/VistaExplorerAnnoyancesandEnhancements_1F83/image_c5d62a82-a4cb-4634-ba7a-8a2a4c3bb871.png" width="77" align="right" border="0" /&gt; You might think this is a post about add-ons to Vista's Windows Explorer, but actually, it's a post about how to &lt;strong&gt;remove&lt;/strong&gt; features in Vista's Explorer to make it actually usable and tolerable to work with.&lt;/p&gt;  &lt;h4&gt;Enhancement #1&lt;/h4&gt;  &lt;p&gt;Vista Explorer has the most annoying ability to "sniff folders" and try and guess what the file types are in your folder.  If .png, .jpg, or other image related file types exist in your folder, Explorer will switch to a "thumbnail/Large Icon" view, even though you've explicitly set a view to "apply to all" folders.  Here's how to get rid of the annoying behavior.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html" href="http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html"&gt;http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Enhancement #2&lt;/h4&gt;  &lt;p&gt;Vista Explorer forgets size &amp;amp; location.  Make Vista Explorer remember the size of the explorer window.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://jtbworld.blogspot.com/2007/04/remember-vista-windows-explorer-window.html" href="http://jtbworld.blogspot.com/2007/04/remember-vista-windows-explorer-window.html"&gt;http://jtbworld.blogspot.com/2007/04/remember-vista-windows-explorer-window.html&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Enhancement #3&lt;/h4&gt;  &lt;p&gt;Segoe UI is the most annoying font in the world.  Change it here:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://steve.fsxtreme.com/blogs/2008/01/16/say-no-to-segoe-and-cleartype-on-vista/" href="http://steve.fsxtreme.com/blogs/2008/01/16/say-no-to-segoe-and-cleartype-on-vista/"&gt;http://steve.fsxtreme.com/blogs/2008/01/16/say-no-to-segoe-and-cleartype-on-vista/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Seriously, the Windows Shell Team did a terrible job with Vista and they all need a few basic lessons on usability...&lt;/p&gt;  &lt;p&gt;&lt;img alt="fighting0016.gif" src="http://bchavez.bitarmory.com/Images/emotions/fighting0016.gif" /&gt;&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/47.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/02/13/vista-explorer-annoyances-and-enhancements.aspx</guid>
            <pubDate>Wed, 13 Feb 2008 20:08:40 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/47.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/02/13/vista-explorer-annoyances-and-enhancements.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/47.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/47.aspx</trackback:ping>
        </item>
        <item>
            <title>The Bit Armory Visual Studio Theme</title>
            <link>http://bchavez.bitarmory.com/archive/2008/02/01/the-bit-armory-visual-studio-theme.aspx</link>
            <description>&lt;p&gt;I recently upgraded to Vista 64-bit, and got hooked on the eye candy.  So, I decided to pimp out my IDE with my company's color theme. :)  Still working on some of the colors, but looks pretty good huh? Any suggestions?  I'm thinking I should tone down the save/modify color tracks near the line numbers so it fits in more....&lt;/p&gt;  &lt;p&gt;&lt;a href="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/TheBitArmoryVisualStudioTheme_119A0/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="1184" alt="image" src="http://bchavez.bitarmory.com/images/bchavez_bitarmory_com/WindowsLiveWriter/TheBitArmoryVisualStudioTheme_119A0/image_thumb_2.png" width="620" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://bchavez.bitarmory.com/aggbug/44.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brian Chavez</dc:creator>
            <guid>http://bchavez.bitarmory.com/archive/2008/02/01/the-bit-armory-visual-studio-theme.aspx</guid>
            <pubDate>Sat, 02 Feb 2008 04:01:52 GMT</pubDate>
            <wfw:comment>http://bchavez.bitarmory.com/comments/44.aspx</wfw:comment>
            <comments>http://bchavez.bitarmory.com/archive/2008/02/01/the-bit-armory-visual-studio-theme.aspx#feedback</comments>
            <wfw:commentRss>http://bchavez.bitarmory.com/comments/commentRss/44.aspx</wfw:commentRss>
            <trackback:ping>http://bchavez.bitarmory.com/services/trackbacks/44.aspx</trackback:ping>
        </item>
    </channel>
</rss>