<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>AppVenture</title>
    <link>http://blogs.appventure.com/Kathleen/</link>
    <description />
    <language>en-us</language>
    <copyright>Appventure, Inc.</copyright>
    <lastBuildDate>Thu, 22 Oct 2009 20:12:35 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>blog@appventure.com</managingEditor>
    <webMaster>blog@appventure.com</webMaster>
    <item>
      <trackback:ping>http://blogs.appventure.com/Kathleen/Trackback.aspx?guid=d3d63e4a-d8c6-4da9-83e3-9cba837dbeba</trackback:ping>
      <pingback:server>http://blogs.appventure.com/Kathleen/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.appventure.com/Kathleen/PermaLink,guid,d3d63e4a-d8c6-4da9-83e3-9cba837dbeba.aspx</pingback:target>
      <dc:creator>Kathleen Dollard</dc:creator>
      <wfw:comment>http://blogs.appventure.com/Kathleen/CommentView,guid,d3d63e4a-d8c6-4da9-83e3-9cba837dbeba.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.appventure.com/Kathleen/SyndicationService.asmx/GetEntryCommentsRss?guid=d3d63e4a-d8c6-4da9-83e3-9cba837dbeba</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p class="MsoNormal">
Yippeee!
</p>
        <p class="MsoNormal">
Starting in Beta 2, precompiled T4 templates support the parameter directive:
</p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">&lt;#@ </span>
          <span style="font-family: &quot;Courier New&quot;; color: brown; font-size: 10pt">template</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">
          </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">language</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">VB</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">" </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">inherits</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">TemplateCommon.DotNetBase</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">"
#&gt; </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">&lt;#@ </span>
          <span style="font-family: &quot;Courier New&quot;; color: brown; font-size: 10pt">import</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">
            <span style="mso-spacerun: yes">  </span>
          </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">namespace</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">Universal.TemplateCommon</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">"
#&gt; </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">&lt;#@ </span>
          <span style="font-family: &quot;Courier New&quot;; color: brown; font-size: 10pt">import</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">
            <span style="mso-spacerun: yes">  </span>
          </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">namespace</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">AppVenture.Common</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">"
#&gt; </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">&lt;#@
parameter </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">name</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">Fred</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">" </span>
          <span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt">type</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">="</span>
          <span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt">System.String</span>
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">"
#&gt; </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: &quot;Courier New&quot;; color: black; font-size: 10pt">
          </span>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <p class="MsoNormal">
Parameters aren’t supported yet in Intellisense (the add-in needs to catch up) and
they aren’t highlighted with my set of Add-Ins. But the code above produces:
</p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">       </span>
            <span style="color: blue">Private</span> _FredField <span style="color: blue">As</span><span style="color: blue">String</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
          </span>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: green">'''</span>
            <span style="color: gray">&lt;summary&gt;</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: green">'''Access
the Fred parameter of the template.</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: green">'''</span>
            <span style="color: gray">&lt;/summary&gt;</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: blue">Private</span>
            <span style="color: blue">ReadOnly</span>
            <span style="color: blue">Property</span> Fred() <span style="color: blue">As</span><span style="color: blue">String</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">            </span>
            <span style="color: blue">Get</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">Return</span>
            <span style="color: blue">Me</span>._FredField </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">            </span>
            <span style="color: blue">End</span>
            <span style="color: blue">Get</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: blue">End</span>
            <span style="color: blue">Property</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
          </span>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <p class="MsoNormal">
And the Initializer attempts to assign the value to the parameter :
</p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">       </span>
            <span style="color: blue">Public</span>
            <span style="color: blue">Overrides</span>
            <span style="color: blue">Sub</span> Initialize() </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">            </span>
            <span style="color: blue">MyBase</span>.Initialize() </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">            </span>
            <span style="color: blue">If</span> (<span style="color: blue">Me</span>.Errors.HasErrors
= <span style="color: blue">False</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">Dim</span> FredValueAcquired <span style="color: blue">As</span><span style="color: blue">Boolean</span> = <span style="color: blue">False</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">If</span>
            <span style="color: blue">Me</span>.Session.ContainsKey(<span style="color: #a31515">"Fred"</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">If</span> (<span style="color: blue">GetType</span>(<span style="color: blue">String</span>).IsAssignableFrom(<span style="color: blue">Me</span>.Session(<span style="color: #a31515">"Fred"</span>).GetType)
= <span style="color: blue">False</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>
            <span style="color: blue">Me</span>.Error(<span style="color: #a31515">"The
type 'System.String' of the parameter 'Fred' did not match the type of the da"</span> &amp;
_ </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                                </span>
            <span style="color: #a31515">"ta
passed to the template."</span>) </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">Else</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>
            <span style="color: blue">Me</span>._FredField
= <span style="color: blue">CType</span>(<span style="color: blue">Me</span>.Session(<span style="color: #a31515">"Fred"</span>), <span style="color: blue">String</span>) </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>FredValueAcquired
= <span style="color: blue">True</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">If</span> (FredValueAcquired
= <span style="color: blue">False</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">Dim</span> data <span style="color: blue">As</span><span style="color: blue">Object</span> = <span style="color: blue">Global</span>.System.Runtime.Remoting.Messaging.<span style="color: #2b91af">CallContext</span>.LogicalGetData(<span style="color: #a31515">"Fred"</span>) </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">If</span> (<span style="color: blue">Not</span> (data) <span style="color: blue">Is</span><span style="color: blue">Nothing</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>
            <span style="color: blue">If</span> (<span style="color: blue">GetType</span>(<span style="color: blue">String</span>).IsAssignableFrom(data.GetType)
= <span style="color: blue">False</span>) <span style="color: blue">Then</span></span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                            </span>
            <span style="color: blue">Me</span>.Error(<span style="color: #a31515">"The
type 'System.String' of the parameter 'Fred' did not match the type of the da"</span> &amp;
_ </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                                    </span>
            <span style="color: #a31515">"ta
passed to the template."</span>) </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>
            <span style="color: blue">Else</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                            </span>
            <span style="color: blue">Me</span>._FredField
= <span style="color: blue">CType</span>(data, <span style="color: blue">String</span>) </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                        </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                    </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">                </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
          </span>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
          </span>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">            </span>
            <span style="color: blue">End</span>
            <span style="color: blue">If</span>
          </span>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal">
          <span style="font-family: consolas; font-size: 9.5pt">
            <span style="mso-spacerun: yes">        </span>
            <span style="color: blue">End</span>
            <span style="color: blue">Sub </span>
            <p>
            </p>
          </span>
        </p>
        <p>
        </p>
        <p class="MsoNormal">
          <span style="mso-spacerun: yes"> </span>
        </p>
        <p>
Thanks to Gareth Jones for listening to the occasionally loud input and making this
happen! 
</p>
        <img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=d3d63e4a-d8c6-4da9-83e3-9cba837dbeba" />
      </body>
      <title>T4 Templates Natively Support Parameters!</title>
      <guid isPermaLink="false">http://blogs.appventure.com/Kathleen/PermaLink,guid,d3d63e4a-d8c6-4da9-83e3-9cba837dbeba.aspx</guid>
      <link>http://blogs.appventure.com/Kathleen/2009/10/22/T4TemplatesNativelySupportParameters.aspx</link>
      <pubDate>Thu, 22 Oct 2009 20:12:35 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
Yippeee!
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
Starting in Beta 2, precompiled T4 templates support the parameter directive:
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;lt;#@ &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: brown; font-size: 10pt"&gt;template&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt; &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;language&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;VB&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot; &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;inherits&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;TemplateCommon.DotNetBase&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot;
#&amp;gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;lt;#@ &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: brown; font-size: 10pt"&gt;import&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;namespace&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;Universal.TemplateCommon&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot;
#&amp;gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;lt;#@ &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: brown; font-size: 10pt"&gt;import&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;namespace&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;AppVenture.Common&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot;
#&amp;gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;lt;#@
parameter &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;name&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;Fred&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot; &lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: red; font-size: 10pt"&gt;type&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: blue; font-size: 10pt"&gt;System.String&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&amp;quot;
#&amp;gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; color: black; font-size: 10pt"&gt;&lt;/span&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
Parameters aren’t supported yet in Intellisense (the add-in needs to catch up) and
they aren’t highlighted with my set of Add-Ins. But the code above produces:
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Private&lt;/span&gt; _FredField &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;/span&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;'''&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;'''Access
the Fred parameter of the template.&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;'''&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Private&lt;/span&gt; &lt;span style="color: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: blue"&gt;Property&lt;/span&gt; Fred() &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Get&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Return&lt;/span&gt; &lt;span style="color: blue"&gt;Me&lt;/span&gt;._FredField &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Get&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Property&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;/span&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
And the Initializer attempts to assign the value to the parameter :
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;Overrides&lt;/span&gt; &lt;span style="color: blue"&gt;Sub&lt;/span&gt; Initialize() &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;MyBase&lt;/span&gt;.Initialize() &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; (&lt;span style="color: blue"&gt;Me&lt;/span&gt;.Errors.HasErrors
= &lt;span style="color: blue"&gt;False&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Dim&lt;/span&gt; FredValueAcquired &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Boolean&lt;/span&gt; = &lt;span style="color: blue"&gt;False&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;span style="color: blue"&gt;Me&lt;/span&gt;.Session.ContainsKey(&lt;span style="color: #a31515"&gt;&amp;quot;Fred&amp;quot;&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; (&lt;span style="color: blue"&gt;GetType&lt;/span&gt;(&lt;span style="color: blue"&gt;String&lt;/span&gt;).IsAssignableFrom(&lt;span style="color: blue"&gt;Me&lt;/span&gt;.Session(&lt;span style="color: #a31515"&gt;&amp;quot;Fred&amp;quot;&lt;/span&gt;).GetType)
= &lt;span style="color: blue"&gt;False&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Me&lt;/span&gt;.Error(&lt;span style="color: #a31515"&gt;&amp;quot;The
type 'System.String' of the parameter 'Fred' did not match the type of the da&amp;quot;&lt;/span&gt; &amp;amp;
_ &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;quot;ta
passed to the template.&amp;quot;&lt;/span&gt;) &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Else&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Me&lt;/span&gt;._FredField
= &lt;span style="color: blue"&gt;CType&lt;/span&gt;(&lt;span style="color: blue"&gt;Me&lt;/span&gt;.Session(&lt;span style="color: #a31515"&gt;&amp;quot;Fred&amp;quot;&lt;/span&gt;), &lt;span style="color: blue"&gt;String&lt;/span&gt;) &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;FredValueAcquired
= &lt;span style="color: blue"&gt;True&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; (FredValueAcquired
= &lt;span style="color: blue"&gt;False&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Dim&lt;/span&gt; data &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Object&lt;/span&gt; = &lt;span style="color: blue"&gt;Global&lt;/span&gt;.System.Runtime.Remoting.Messaging.&lt;span style="color: #2b91af"&gt;CallContext&lt;/span&gt;.LogicalGetData(&lt;span style="color: #a31515"&gt;&amp;quot;Fred&amp;quot;&lt;/span&gt;) &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; (&lt;span style="color: blue"&gt;Not&lt;/span&gt; (data) &lt;span style="color: blue"&gt;Is&lt;/span&gt; &lt;span style="color: blue"&gt;Nothing&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;If&lt;/span&gt; (&lt;span style="color: blue"&gt;GetType&lt;/span&gt;(&lt;span style="color: blue"&gt;String&lt;/span&gt;).IsAssignableFrom(data.GetType)
= &lt;span style="color: blue"&gt;False&lt;/span&gt;) &lt;span style="color: blue"&gt;Then&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Me&lt;/span&gt;.Error(&lt;span style="color: #a31515"&gt;&amp;quot;The
type 'System.String' of the parameter 'Fred' did not match the type of the da&amp;quot;&lt;/span&gt; &amp;amp;
_ &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;quot;ta
passed to the template.&amp;quot;&lt;/span&gt;) &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Else&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;Me&lt;/span&gt;._FredField
= &lt;span style="color: blue"&gt;CType&lt;/span&gt;(data, &lt;span style="color: blue"&gt;String&lt;/span&gt;) &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;/span&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;/span&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="font-family: consolas; font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Sub &lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Thanks to Gareth Jones for listening to the occasionally loud input and making this
happen! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=d3d63e4a-d8c6-4da9-83e3-9cba837dbeba" /&gt;</description>
      <comments>http://blogs.appventure.com/Kathleen/CommentView,guid,d3d63e4a-d8c6-4da9-83e3-9cba837dbeba.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.appventure.com/Kathleen/Trackback.aspx?guid=cf1b564f-b920-471c-932a-9090eedc6e59</trackback:ping>
      <pingback:server>http://blogs.appventure.com/Kathleen/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.appventure.com/Kathleen/PermaLink,guid,cf1b564f-b920-471c-932a-9090eedc6e59.aspx</pingback:target>
      <dc:creator>Kathleen Dollard</dc:creator>
      <wfw:comment>http://blogs.appventure.com/Kathleen/CommentView,guid,cf1b564f-b920-471c-932a-9090eedc6e59.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.appventure.com/Kathleen/SyndicationService.asmx/GetEntryCommentsRss?guid=cf1b564f-b920-471c-932a-9090eedc6e59</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Preprocessed templates are very cool (see <a href="http://blogs.appventure.com/Kathleen/2009/09/04/WhyIsAPreprocessedTemplateTheCoolestThingSinceSlicedBread.aspx">this</a> post).
When I explained them to Karl Shifflett on the phone one day, once he got it he got
excited and said “wow, this is just what I’ve been waiting for”. Preprocessed templates
are very cool. 
</p>
        <p>
But, what if you don’t want to commit your entire development to Visual Studio 2010?
What if you don’t want beta software on every dev machine. Preprocessed templates
are part of Visual Studio. Ah, what to do?
</p>
        <p>
Do what I do. Down target to 3.5.
</p>
        <p>
The core concept of preprocessed templates is that when the custom tool runs you create
a normal, normal, normal, normal .NET class that when run will produce your artifact
(such as code). It’s a normal class (really). The custom tool runs either when you
save, or when you explicitly run the tool. Take a look at the code so you understand
the simplicity of what’s happening. But realize the specific code will change in Beta
2, so don’t get caught up by the current messiness. 
</p>
        <p>
You control the references and the project properties of this completely normal .NET
class and assembly. You can set the target for this assembly to .NET 3.5. Every single
thing you do in your development process, except the editing of templates and saving
them, can be done in Visual Studio 2008 and .NET 3.5 (or potentially below, but LINQ
is powerful in templates). You only need to have one boot or VPC in your organization
that deals with the VS 2010 betas. I’m running it side by side on my dev box, but
I would recommend you follow all the Microsoft warnings unless rebuilding systems
is a favorite pastime. 
</p>
        <p>
Assuming you build the MEF preview against .NET 3.5, you can also use MEF in your
templates.
</p>
        <p>
This doesn’t mean you can directly use the “custom-tool-does-it-all” approach encouraged
by VS 2008 (which is an approach I dislike). You still need a harness of some sort,
and I really owe a blog post on that. But I’m heading to Nepal so it may be a while.
In the meantime, perhaps one of the custom tool geeks can create a custom tool that
knows how to run preprocessed templates, possibly through MEF. Oh, dear, that’s another
post…and really, I need to pack… you would not want me to forget slippers…
</p>
        <img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=cf1b564f-b920-471c-932a-9090eedc6e59" />
      </body>
      <title>Preprocessed Templates and .NET 3.5</title>
      <guid isPermaLink="false">http://blogs.appventure.com/Kathleen/PermaLink,guid,cf1b564f-b920-471c-932a-9090eedc6e59.aspx</guid>
      <link>http://blogs.appventure.com/Kathleen/2009/09/19/PreprocessedTemplatesAndNET35.aspx</link>
      <pubDate>Sat, 19 Sep 2009 15:18:25 GMT</pubDate>
      <description>&lt;p&gt;
Preprocessed templates are very cool (see &lt;a href="http://blogs.appventure.com/Kathleen/2009/09/04/WhyIsAPreprocessedTemplateTheCoolestThingSinceSlicedBread.aspx"&gt;this&lt;/a&gt; post).
When I explained them to Karl Shifflett on the phone one day, once he got it he got
excited and said “wow, this is just what I’ve been waiting for”. Preprocessed templates
are very cool. 
&lt;/p&gt;
&lt;p&gt;
But, what if you don’t want to commit your entire development to Visual Studio 2010?
What if you don’t want beta software on every dev machine. Preprocessed templates
are part of Visual Studio. Ah, what to do?
&lt;/p&gt;
&lt;p&gt;
Do what I do. Down target to 3.5.
&lt;/p&gt;
&lt;p&gt;
The core concept of preprocessed templates is that when the custom tool runs you create
a normal, normal, normal, normal .NET class that when run will produce your artifact
(such as code). It’s a normal class (really). The custom tool runs either when you
save, or when you explicitly run the tool. Take a look at the code so you understand
the simplicity of what’s happening. But realize the specific code will change in Beta
2, so don’t get caught up by the current messiness. 
&lt;/p&gt;
&lt;p&gt;
You control the references and the project properties of this completely normal .NET
class and assembly. You can set the target for this assembly to .NET 3.5. Every single
thing you do in your development process, except the editing of templates and saving
them, can be done in Visual Studio 2008 and .NET 3.5 (or potentially below, but LINQ
is powerful in templates). You only need to have one boot or VPC in your organization
that deals with the VS 2010 betas. I’m running it side by side on my dev box, but
I would recommend you follow all the Microsoft warnings unless rebuilding systems
is a favorite pastime. 
&lt;/p&gt;
&lt;p&gt;
Assuming you build the MEF preview against .NET 3.5, you can also use MEF in your
templates.
&lt;/p&gt;
&lt;p&gt;
This doesn’t mean you can directly use the “custom-tool-does-it-all” approach encouraged
by VS 2008 (which is an approach I dislike). You still need a harness of some sort,
and I really owe a blog post on that. But I’m heading to Nepal so it may be a while.
In the meantime, perhaps one of the custom tool geeks can create a custom tool that
knows how to run preprocessed templates, possibly through MEF. Oh, dear, that’s another
post…and really, I need to pack… you would not want me to forget slippers…
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=cf1b564f-b920-471c-932a-9090eedc6e59" /&gt;</description>
      <comments>http://blogs.appventure.com/Kathleen/CommentView,guid,cf1b564f-b920-471c-932a-9090eedc6e59.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.appventure.com/Kathleen/Trackback.aspx?guid=f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f</trackback:ping>
      <pingback:server>http://blogs.appventure.com/Kathleen/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.appventure.com/Kathleen/PermaLink,guid,f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f.aspx</pingback:target>
      <dc:creator>Kathleen Dollard</dc:creator>
      <wfw:comment>http://blogs.appventure.com/Kathleen/CommentView,guid,f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.appventure.com/Kathleen/SyndicationService.asmx/GetEntryCommentsRss?guid=f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here is the initial public alpha release of the Community Generation Harness
</p>
        <p>
AppVenture has two tools. AppVenture Foundations is the core tool we use in our business.
We'd love to talk to you about it, but it's an entirely different lineage than the
Community Generation Harness.
</p>
        <p>
The Community Generation Harness is a freely available tool which we will move to
an open source site if it gathers a community. It leans out over the cutting edge
to show you what's possible with code generation and MEF. It's misnamed a bit, because
it is actually a general purpose processing engine. Watch for more blog posts on how
to customize it for your own use. And don't miss the ReadMe file. It explains what
to do with the download. 
</p>
        <p>
        </p>
        <a href="http://blogs.appventure.com/Kathleen/content/binary/T4Host%2020090906.zip">T4Host
20090906.zip (1.5 MB)</a>
        <img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f" />
      </body>
      <title>Community Generation Harness</title>
      <guid isPermaLink="false">http://blogs.appventure.com/Kathleen/PermaLink,guid,f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f.aspx</guid>
      <link>http://blogs.appventure.com/Kathleen/2009/09/06/CommunityGenerationHarness.aspx</link>
      <pubDate>Sun, 06 Sep 2009 16:01:24 GMT</pubDate>
      <description>&lt;p&gt;
Here is the initial public alpha release of the Community Generation Harness
&lt;/p&gt;
&lt;p&gt;
AppVenture has two tools. AppVenture Foundations is the core tool we use in our business.
We'd love to talk to you about it, but it's an entirely different lineage than the
Community Generation Harness.
&lt;/p&gt;
&lt;p&gt;
The Community Generation Harness is a freely available tool which we will move to
an open source site if it gathers a community. It leans out over the cutting edge
to show you what's possible with code generation and MEF. It's misnamed a bit, because
it is actually a general purpose processing engine. Watch for more blog posts on how
to customize it for your own use. And don't miss the ReadMe file. It explains what
to do with the download. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;a href="http://blogs.appventure.com/Kathleen/content/binary/T4Host%2020090906.zip"&gt;T4Host
20090906.zip (1.5 MB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f" /&gt;</description>
      <comments>http://blogs.appventure.com/Kathleen/CommentView,guid,f6ff479b-b95c-4ff7-aefa-ad6260d0fb8f.aspx</comments>
      <category>Code Generation</category>
    </item>
    <item>
      <trackback:ping>http://blogs.appventure.com/Kathleen/Trackback.aspx?guid=be407250-f960-4c38-baf3-ef7dea0ce508</trackback:ping>
      <pingback:server>http://blogs.appventure.com/Kathleen/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.appventure.com/Kathleen/PermaLink,guid,be407250-f960-4c38-baf3-ef7dea0ce508.aspx</pingback:target>
      <dc:creator>Kathleen Dollard</dc:creator>
      <wfw:comment>http://blogs.appventure.com/Kathleen/CommentView,guid,be407250-f960-4c38-baf3-ef7dea0ce508.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.appventure.com/Kathleen/SyndicationService.asmx/GetEntryCommentsRss?guid=be407250-f960-4c38-baf3-ef7dea0ce508</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
OK, really, it’s cooler than sliced bread.
</p>
        <p>
When you create any file in Visual Studio you have the option to run a custom tool.
Visual Studio and add-ins use this tool to do extra work – often generating a dependent
file. In Visual Studio 2010, if you create a T4 template there are two options for
the custom tool that runs. 
</p>
        <h1> 
</h1>
        <h2>Option 1 – Text Template
</h2>
        <p>
This style is consistent with VS 2008 and the DSL Toolkit.
</p>
        <p>
The plain style of T4 templates evaluates the template places the result as an output
file. If you create a T4 template that is “Hello World” you get a dependent file with
the specified extension that contains “Hello World”. 
</p>
        <p>
There are two steps of metadata to artifact transformation going on here. First, the
template is transformed into normal .NET code. This code is emitted and run to produce
the result. The result as a string is output into the file you see.
</p>
        <p>
There are two transformation steps and two .NET compile steps (although the full compile
of your output is delayed in C#). For example, if you output “Hello World” as a C#
code, it’s not legal code so you get a compile error. You can also create templates
that have .NET errors in the code of the template, and this creates errors in the
interim emitted code when it is compiled.
</p>
        <p>
 
</p>
        <h2>Option 2 – Preprocessed Text Template
</h2>
        <p>
The second option is to create a preprocessed template, which uses a different custom
tool than the text template. This custom tool does the first step – creates .NET code
which when run will create your output. This code is output as the dependent file.
If you create a “Hello World” template, you’ll see a bunch of gunk that runs the template
and a TransformText method. Within the TransformText method, you’ll see GenerationContext.AppendLine(“Hello
World”). 
</p>
        <p>
The class contains a good deal of additional gunk which frees the base class. You
can inherit from any class you want. You can define the alternate base class either
with the inherits attribute of the template directive, or in a separate partial class. 
</p>
        <p>
You need external code, a template harness of some sort, to create your actual output.
This is very simple code: it creates an instance of your templates class, runs the
TransformText method, and outputs the result to a file. More on harnesses coming here
soon.
</p>
        <p>
You can also define additional code in a partial class for your template. This can
include attributes, such as MEF attributes. It can also can include properties that
can be set from the outside when the template is run, or attributed to be automatically
filled with MEF. 
</p>
        <p>
This is VS 2010 Beta 1 behavior. The code output as the preprocessed template will
change significantly in Beta 2. A logical enhancement would be including support for
a parameter directive which would automatically create this property for you. You’ll
still have to supply data.
</p>
        <p>
 
</p>
        <h2>Why are Preprocessed Templates this so Cool?
</h2>
        <p>
The primary reason is that they let you get your hands on that emitted code. This
is the code that actually runs, and code which frequently will contain compiler errors
because of some dumb thing you do in the template. Often, the T4 engine correctly
backtracks these errors into the template, and/or provides enough debugging. But both
of these tasks sometimes come up short leaving you with a compile or debugging challenge.
I also frequently drop into this code to take advantage of native Intellisense, then
copying the code back into the T4 template. 
</p>
        <p>
It also makes running the T4 template much easier. 
</p>
        <p>
If you’re running within Visual Studio directly to get output, you’ll find many challenges
around accessing your metadata. While the T4 Toobox on CodePlex.com does an amazing
job circumventing these issues, it results in complex brittle templates that have
a serious separation of concerns issue as they simultaneously access metadata, manage
and output files, and define output code. 
</p>
        <p>
Instead, you can run templates through a harness of some type. This makes the process
similar to that using tools such as CodeSmith or CodeBreeze. Unfortunately, the design
of T4 and the single file generator that is used by Visual Studio combine to make
writing a T4 harness for plain T4 templates extremely challenging and just mucky. 
</p>
        <p>
Preprocessed templates redefine this process. The preprocessed code is a normal .NET
class and the harness calls its TransformText template like any other .NET code, grabs
the string, and outputs the file. Outputting multiple files is simple, and the harness
can adopt additional sophistication, such as MEF provided metadata or overwrite protection. 
</p>
        <p>
 
</p>
        <h2>Eleven Great Things about Preprocessed T4 Templates
</h2>
        <p>
The first great thing about T4 preprocessed templates is that you get a syntax check
on save, and a full compiler check as soon as you run the compiler (or on save in
VB). With traditional templates, you know about problems in the template when you
attempt to output code. 
</p>
        <p>
The second great thing about T4 preprocessed templates is that you have access to
a base class. A custom base class can manage all the metadata for a family of templates
using the same metadata and significantly improve reuse. 
</p>
        <p>
The third great thing about T4 preprocessed templates is that you have a partial class
for any additional code or class attributes you might want to include. 
</p>
        <p>
The fourth great thing about T4 preprocessed templates is that they make writing a
harness for T4 templates a few order of magnitude easier – making it very simple to
do.
</p>
        <p>
The fifth great thing about T4 preprocessed templates is that you can include T4 transformations
within your application. It’s just .NET code – you can run it whenever, however, why-ever
you want. This means T4 templates are not just for code anymore. You can use them
for any metadata to artifact generation, such as form letters, as long as you can
recompile and redeploy template changes. MEF can help here as well because you just
need to distribute small dlls with the changes and variations.
</p>
        <p>
The sixth great thing about T4 preprocessed templates is that they run equally well
in the main .NET framework and Silverlight. Or even mobile. 
</p>
        <p>
The seventh great thing about T4 preprocessed templates is that they are easier to
debug. You have access to the code that will actually run, allowing you to debug the
actual failing code, not the T4 template from which that code was derived. 
</p>
        <p>
The eighth great thing about T4 preprocessed templates is understanding what’s really
happening when you run your template code. The logic of your template can sometimes
be obscured by the overlay of T4 template logic and output code logic. The preprocessed
code let’s you better understand the logic you wrote into your template.
</p>
        <p>
The ninth great thing about T4 preprocessed templates is that you can get Intellisense
directly within the preprocessed output, regardless of the AddIns you have in play. 
</p>
        <p>
The tenth great thing about T4 preprocessed templates is that they are NOT restricted
to .NET 4.0. By down-targeting the preprocessed output, you create a dll which can
be run in any appropriate version of the .NET framework. A .NET 3.5 harness can easily
run preprocessed templates. You ONLY need the VS 2010 Beta when you are altering templates.
The rest can be done on machines running only VS 2008. 
</p>
        <p>
The eleventh great thing about T4 preprocessed templates is that they remain T4. They
use the same simple ASP.NET template style. Microsoft is making an increasing commitment
to T4 with its use in LINQ to Entities, and MVC. I anticipate T4 will crop up in many
additional tools from both within in and outside Microsoft – with CodeBreeze already
making a commitment to support it in the next version. 
</p>
        <p>
You can get a different take on preprocessed templates on the Clarius blog <a href="http://www.clariusconsulting.net/blogs/pga/archive/2009/07/15/160836.aspx">here</a> and <a href="http://www.clariusconsulting.net/blogs/pga/archive/2009/7/15.aspx">here</a>. 
</p>
        <img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=be407250-f960-4c38-baf3-ef7dea0ce508" />
      </body>
      <title>Why is a Preprocessed Template the Coolest Thing since Sliced Bread</title>
      <guid isPermaLink="false">http://blogs.appventure.com/Kathleen/PermaLink,guid,be407250-f960-4c38-baf3-ef7dea0ce508.aspx</guid>
      <link>http://blogs.appventure.com/Kathleen/2009/09/04/WhyIsAPreprocessedTemplateTheCoolestThingSinceSlicedBread.aspx</link>
      <pubDate>Fri, 04 Sep 2009 19:19:18 GMT</pubDate>
      <description>&lt;p&gt;
OK, really, it’s cooler than sliced bread.
&lt;/p&gt;
&lt;p&gt;
When you create any file in Visual Studio you have the option to run a custom tool.
Visual Studio and add-ins use this tool to do extra work – often generating a dependent
file. In Visual Studio 2010, if you create a T4 template there are two options for
the custom tool that runs. 
&lt;/p&gt;
&lt;h1&gt;&amp;#160;
&lt;/h1&gt;
&lt;h2&gt;Option 1 – Text Template
&lt;/h2&gt;
&lt;p&gt;
This style is consistent with VS 2008 and the DSL Toolkit.
&lt;/p&gt;
&lt;p&gt;
The plain style of T4 templates evaluates the template places the result as an output
file. If you create a T4 template that is “Hello World” you get a dependent file with
the specified extension that contains “Hello World”. 
&lt;/p&gt;
&lt;p&gt;
There are two steps of metadata to artifact transformation going on here. First, the
template is transformed into normal .NET code. This code is emitted and run to produce
the result. The result as a string is output into the file you see.
&lt;/p&gt;
&lt;p&gt;
There are two transformation steps and two .NET compile steps (although the full compile
of your output is delayed in C#). For example, if you output “Hello World” as a C#
code, it’s not legal code so you get a compile error. You can also create templates
that have .NET errors in the code of the template, and this creates errors in the
interim emitted code when it is compiled.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;h2&gt;Option 2 – Preprocessed Text Template
&lt;/h2&gt;
&lt;p&gt;
The second option is to create a preprocessed template, which uses a different custom
tool than the text template. This custom tool does the first step – creates .NET code
which when run will create your output. This code is output as the dependent file.
If you create a “Hello World” template, you’ll see a bunch of gunk that runs the template
and a TransformText method. Within the TransformText method, you’ll see GenerationContext.AppendLine(“Hello
World”). 
&lt;/p&gt;
&lt;p&gt;
The class contains a good deal of additional gunk which frees the base class. You
can inherit from any class you want. You can define the alternate base class either
with the inherits attribute of the template directive, or in a separate partial class. 
&lt;/p&gt;
&lt;p&gt;
You need external code, a template harness of some sort, to create your actual output.
This is very simple code: it creates an instance of your templates class, runs the
TransformText method, and outputs the result to a file. More on harnesses coming here
soon.
&lt;/p&gt;
&lt;p&gt;
You can also define additional code in a partial class for your template. This can
include attributes, such as MEF attributes. It can also can include properties that
can be set from the outside when the template is run, or attributed to be automatically
filled with MEF. 
&lt;/p&gt;
&lt;p&gt;
This is VS 2010 Beta 1 behavior. The code output as the preprocessed template will
change significantly in Beta 2. A logical enhancement would be including support for
a parameter directive which would automatically create this property for you. You’ll
still have to supply data.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;h2&gt;Why are Preprocessed Templates this so Cool?
&lt;/h2&gt;
&lt;p&gt;
The primary reason is that they let you get your hands on that emitted code. This
is the code that actually runs, and code which frequently will contain compiler errors
because of some dumb thing you do in the template. Often, the T4 engine correctly
backtracks these errors into the template, and/or provides enough debugging. But both
of these tasks sometimes come up short leaving you with a compile or debugging challenge.
I also frequently drop into this code to take advantage of native Intellisense, then
copying the code back into the T4 template. 
&lt;/p&gt;
&lt;p&gt;
It also makes running the T4 template much easier. 
&lt;/p&gt;
&lt;p&gt;
If you’re running within Visual Studio directly to get output, you’ll find many challenges
around accessing your metadata. While the T4 Toobox on CodePlex.com does an amazing
job circumventing these issues, it results in complex brittle templates that have
a serious separation of concerns issue as they simultaneously access metadata, manage
and output files, and define output code. 
&lt;/p&gt;
&lt;p&gt;
Instead, you can run templates through a harness of some type. This makes the process
similar to that using tools such as CodeSmith or CodeBreeze. Unfortunately, the design
of T4 and the single file generator that is used by Visual Studio combine to make
writing a T4 harness for plain T4 templates extremely challenging and just mucky. 
&lt;/p&gt;
&lt;p&gt;
Preprocessed templates redefine this process. The preprocessed code is a normal .NET
class and the harness calls its TransformText template like any other .NET code, grabs
the string, and outputs the file. Outputting multiple files is simple, and the harness
can adopt additional sophistication, such as MEF provided metadata or overwrite protection. 
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;h2&gt;Eleven Great Things about Preprocessed T4 Templates
&lt;/h2&gt;
&lt;p&gt;
The first great thing about T4 preprocessed templates is that you get a syntax check
on save, and a full compiler check as soon as you run the compiler (or on save in
VB). With traditional templates, you know about problems in the template when you
attempt to output code. 
&lt;/p&gt;
&lt;p&gt;
The second great thing about T4 preprocessed templates is that you have access to
a base class. A custom base class can manage all the metadata for a family of templates
using the same metadata and significantly improve reuse. 
&lt;/p&gt;
&lt;p&gt;
The third great thing about T4 preprocessed templates is that you have a partial class
for any additional code or class attributes you might want to include. 
&lt;/p&gt;
&lt;p&gt;
The fourth great thing about T4 preprocessed templates is that they make writing a
harness for T4 templates a few order of magnitude easier – making it very simple to
do.
&lt;/p&gt;
&lt;p&gt;
The fifth great thing about T4 preprocessed templates is that you can include T4 transformations
within your application. It’s just .NET code – you can run it whenever, however, why-ever
you want. This means T4 templates are not just for code anymore. You can use them
for any metadata to artifact generation, such as form letters, as long as you can
recompile and redeploy template changes. MEF can help here as well because you just
need to distribute small dlls with the changes and variations.
&lt;/p&gt;
&lt;p&gt;
The sixth great thing about T4 preprocessed templates is that they run equally well
in the main .NET framework and Silverlight. Or even mobile. 
&lt;/p&gt;
&lt;p&gt;
The seventh great thing about T4 preprocessed templates is that they are easier to
debug. You have access to the code that will actually run, allowing you to debug the
actual failing code, not the T4 template from which that code was derived. 
&lt;/p&gt;
&lt;p&gt;
The eighth great thing about T4 preprocessed templates is understanding what’s really
happening when you run your template code. The logic of your template can sometimes
be obscured by the overlay of T4 template logic and output code logic. The preprocessed
code let’s you better understand the logic you wrote into your template.
&lt;/p&gt;
&lt;p&gt;
The ninth great thing about T4 preprocessed templates is that you can get Intellisense
directly within the preprocessed output, regardless of the AddIns you have in play. 
&lt;/p&gt;
&lt;p&gt;
The tenth great thing about T4 preprocessed templates is that they are NOT restricted
to .NET 4.0. By down-targeting the preprocessed output, you create a dll which can
be run in any appropriate version of the .NET framework. A .NET 3.5 harness can easily
run preprocessed templates. You ONLY need the VS 2010 Beta when you are altering templates.
The rest can be done on machines running only VS 2008. 
&lt;/p&gt;
&lt;p&gt;
The eleventh great thing about T4 preprocessed templates is that they remain T4. They
use the same simple ASP.NET template style. Microsoft is making an increasing commitment
to T4 with its use in LINQ to Entities, and MVC. I anticipate T4 will crop up in many
additional tools from both within in and outside Microsoft – with CodeBreeze already
making a commitment to support it in the next version. 
&lt;/p&gt;
&lt;p&gt;
You can get a different take on preprocessed templates on the Clarius blog &lt;a href="http://www.clariusconsulting.net/blogs/pga/archive/2009/07/15/160836.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://www.clariusconsulting.net/blogs/pga/archive/2009/7/15.aspx"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=be407250-f960-4c38-baf3-ef7dea0ce508" /&gt;</description>
      <comments>http://blogs.appventure.com/Kathleen/CommentView,guid,be407250-f960-4c38-baf3-ef7dea0ce508.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://blogs.appventure.com/Kathleen/Trackback.aspx?guid=b5262581-ae0b-4aa3-89b3-33039ad4fe12</trackback:ping>
      <pingback:server>http://blogs.appventure.com/Kathleen/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.appventure.com/Kathleen/PermaLink,guid,b5262581-ae0b-4aa3-89b3-33039ad4fe12.aspx</pingback:target>
      <dc:creator>Kathleen Dollard</dc:creator>
      <wfw:comment>http://blogs.appventure.com/Kathleen/CommentView,guid,b5262581-ae0b-4aa3-89b3-33039ad4fe12.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.appventure.com/Kathleen/SyndicationService.asmx/GetEntryCommentsRss?guid=b5262581-ae0b-4aa3-89b3-33039ad4fe12</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Wow, I’m starting my second blog! 
</p>
        <p>
I plan to continue blogging about general .NET stuff and new technologies like Workflow
and MEF on my personal blog at <a href="http://www.msmvps.com/blogs/kathleen">www.msmvps.com/blogs/kathleen</a>.
But I want to consolidate the code generation posts along with the AppVenture Community
Generation Harness in a single location. My goal with this harness is to let it grow
into an open source tool, and share the thinking behind it. I think the best location
for this is the AppVenture site.
</p>
        <p>
For clarity, AppVenture has two tools (which is not in itself very clear). AppVenture
Foundations is our core tool which we use in business partnerships/consulting/etc.
I’m very proud to be associated with this tool which pushes boundaries in interesting
ways.
</p>
        <p>
But both personally and with the full support of the rest of the AppVenture leadership
team we want a tool available that offers a jumping off point for industry wide evolution
of code generation. We think the community tool is an important first step.
</p>
        <p>
I also plan to generally use this blog to post slides and sample code from user group
talks. 
</p>
        <p>
Welcome!
</p>
        <img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=b5262581-ae0b-4aa3-89b3-33039ad4fe12" />
      </body>
      <title>Welcome</title>
      <guid isPermaLink="false">http://blogs.appventure.com/Kathleen/PermaLink,guid,b5262581-ae0b-4aa3-89b3-33039ad4fe12.aspx</guid>
      <link>http://blogs.appventure.com/Kathleen/2009/09/01/Welcome.aspx</link>
      <pubDate>Tue, 01 Sep 2009 17:35:39 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Wow, I’m starting my second blog! 
&lt;/p&gt;
&lt;p&gt;
I plan to continue blogging about general .NET stuff and new technologies like Workflow
and MEF on my personal blog at &lt;a href="http://www.msmvps.com/blogs/kathleen"&gt;www.msmvps.com/blogs/kathleen&lt;/a&gt;.
But I want to consolidate the code generation posts along with the AppVenture Community
Generation Harness in a single location. My goal with this harness is to let it grow
into an open source tool, and share the thinking behind it. I think the best location
for this is the AppVenture site.
&lt;/p&gt;
&lt;p&gt;
For clarity, AppVenture has two tools (which is not in itself very clear). AppVenture
Foundations is our core tool which we use in business partnerships/consulting/etc.
I’m very proud to be associated with this tool which pushes boundaries in interesting
ways.
&lt;/p&gt;
&lt;p&gt;
But both personally and with the full support of the rest of the AppVenture leadership
team we want a tool available that offers a jumping off point for industry wide evolution
of code generation. We think the community tool is an important first step.
&lt;/p&gt;
&lt;p&gt;
I also plan to generally use this blog to post slides and sample code from user group
talks. 
&lt;/p&gt;
&lt;p&gt;
Welcome!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.appventure.com/Kathleen/aggbug.ashx?id=b5262581-ae0b-4aa3-89b3-33039ad4fe12" /&gt;</description>
      <comments>http://blogs.appventure.com/Kathleen/CommentView,guid,b5262581-ae0b-4aa3-89b3-33039ad4fe12.aspx</comments>
    </item>
  </channel>
</rss>