<?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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>deepdark.net - James Green's Blog - Downloads</title>
    <link>http://deepdark.net/</link>
    <description>.NET, SQL Server and *.*</description>
    <image>
      <url>http://deepdark.net/files/deepdark.jpg</url>
      <title>deepdark.net - James Green's Blog - Downloads</title>
      <link>http://deepdark.net/</link>
    </image>
    <language>en-us</language>
    <copyright>James Green</copyright>
    <lastBuildDate>Tue, 20 Nov 2007 12:37:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>James.Green@deepdark.net</managingEditor>
    <webMaster>James.Green@deepdark.net</webMaster>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just saw these and thought they were worthy of linkage
</p>
        <p>
          <a href="https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=127135">Clinic
2806: Microsoft® Security Guidance Training for Developers</a>.
</p>
        <p>
          <a href="https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=127163">Clinic
2807: Microsoft® Security Guidance Training for Developers II</a>.
</p>
        <p>
There is a good breadth of topics covered, and the price is right :-)
</p>
      </body>
      <title>Free Security Guidance Training for Developers</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8.aspx</link>
      <pubDate>Tue, 20 Nov 2007 12:37:00 GMT</pubDate>
      <description>&lt;p&gt;
I just saw these and thought they were worthy of linkage
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=127135"&gt;Clinic
2806: Microsoft® Security Guidance Training for Developers&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=127163"&gt;Clinic
2807: Microsoft® Security Guidance Training for Developers II&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
There is a good breadth of topics covered, and the price is right :-)
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,0b2ffbc6-f4de-4ef1-af36-b861fe6a0bd8.aspx</comments>
      <category>Downloads</category>
      <category>Geeking Out!</category>
      <category>Secutity</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=c407ee59-bb64-42d0-b1ae-fd79ccf795ea</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,c407ee59-bb64-42d0-b1ae-fd79ccf795ea.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,c407ee59-bb64-42d0-b1ae-fd79ccf795ea.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=c407ee59-bb64-42d0-b1ae-fd79ccf795ea</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">It was great being able to have the opportunity
to elucidate my thoughts on this matter formally at <a href="http://www.sqldownunder.com/">SQL
Down Under Code Camp '07</a>.<br /><br />
For completeness, here are my slides: <a href="content/binary/The%20Zen%20of%20T-SQL%20SDU%20CC.ppt">The
Zen of T-SQL SDU CC.ppt (128.5 KB)</a><br /><br />
I really enjoyed meeting so many nice and very clever folks.  Thanks to Greg
and all involved in putting on the Code Camp, what a really great event!<br /><br />
For the record, the image is of Kasprowicz catching Pietersen at NatWest Challenge
Final, The Oval, 2005.<br /><br />
:-)<p></p></body>
      <title>The Zen of T-SQL - My SQL Down Under Code Camp slides</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,c407ee59-bb64-42d0-b1ae-fd79ccf795ea.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,c407ee59-bb64-42d0-b1ae-fd79ccf795ea.aspx</link>
      <pubDate>Sun, 14 Oct 2007 12:25:08 GMT</pubDate>
      <description>It was great being able to have the opportunity to elucidate my thoughts on this matter formally at &lt;a href="http://www.sqldownunder.com/"&gt;SQL
Down Under Code Camp '07&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
For completeness, here are my slides: &lt;a href="content/binary/The%20Zen%20of%20T-SQL%20SDU%20CC.ppt"&gt;The
Zen of T-SQL SDU CC.ppt (128.5 KB)&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
I really enjoyed meeting so many nice and very clever folks.&amp;nbsp; Thanks to Greg
and all involved in putting on the Code Camp, what a really great event!&lt;br&gt;
&lt;br&gt;
For the record, the image is of Kasprowicz catching Pietersen at NatWest Challenge
Final, The Oval, 2005.&lt;br&gt;
&lt;br&gt;
:-)&lt;p&gt;
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,c407ee59-bb64-42d0-b1ae-fd79ccf795ea.aspx</comments>
      <category>Database</category>
      <category>Downloads</category>
      <category>Geeking Out!</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=e52bc16e-8863-4f99-97e8-9c1daa675a05</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,e52bc16e-8863-4f99-97e8-9c1daa675a05.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,e52bc16e-8863-4f99-97e8-9c1daa675a05.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=e52bc16e-8863-4f99-97e8-9c1daa675a05</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>How to start?</strong>
          <br />
You will need several assemblies.  This is because to reach the level of decoupling
that is desired, the pipeline has a certain pattern of dependencies between projects. 
I’m not sure if I am subconsciously not objecting to it or actually actively like
this now, was not always the way.
</p>
        <p>
          <strong>A pipeline?</strong>
          <br />
Yes, you need one.  
</p>
        <p>
          <strong>What is a pipeline?</strong>
          <br />
It’s a series of folders that live somewhere (does not have to be under your
application's path) and each of the assemblies have their place in the structure. 
The folders will look like this:
</p>
        <p>
          <img src="http://deepdark.net/content/binary/Add-InPipeLinePaths1.jpg" border="0" />
        </p>
        <p>
It’s probably a good idea to build one now in your project tree and set the build
output as you go.
</p>
        <p>
There is a <a href="http://blogs.msdn.com/clraddins/archive/2007/02/23/brief-introduction-to-our-architecture-for-managed-add-ins.aspx">graphic
explaining the pipeline on the CLR Add-In team blog</a> (with nice colours), it is
also in the Orcas MSDN under the title: "Pipeline Development Requirements". 
The MSDN one has the addition of lines to indicate the static dependancies. 
</p>
        <p>
I've chosen to show it differently in my graphics <font color="#a9a9a9" size="1">(don't
say a word!)</font> to indicate the order of it all coming together as well as the
references.  In the graphic the <strong><em>arrow lines illustrate the dependancies
between the projects</em></strong>.
</p>
        <p>
Also, I make reference to the sample code throughout this post.  Download link
is at the bottom.
</p>
        <p>
          <strong>Step 1: Define Contracts </strong>
        </p>
        <p>
The first step is to define the contracts in your contracts assembly and <a href="http://en.wikipedia.org/wiki/Data_Transfer_Object">DTOs
in your DTO’s assembly</a>.
</p>
        <p>
Your contract should be one interface per kind of add-in you will support.  These
interfaces need to inherit <font face="Courier New">System.AddIn.Contract.<font color="#0000ff">IContract</font></font> and
be decorated with <font face="Courier New">System.AddIn.Pipeline.<font color="#0000ff">AddInContractAttribute</font></font>.
</p>
        <p>
Types in the DTO that you wish to pass over the boundary will need to be serializable.
</p>
        <p>
          <img src="http://deepdark.net/content/binary/AddInStep0.jpg" border="0" />
        </p>
        <p>
Jason He’s example of a Paint.NET Add-In (link below) takes a different path,
by adding the extra types in the Add-In View, adding more wrappers.  His approach
may have advantages that I have not discovered yet, but it reminds me of some of the
dancing you have to do when for example you have the same type in a Web Reference
and a binary reference in the same project.  
</p>
        <p>
My preference is then to make a behavior-free separate assembly that anyone can take
a dependency on safely.  This is the reason for including a DTO project. 
I also like having the DTO types there to do as a [DataContract] does in WCF. 
This will allow the Add-In contract to remain static if the host side changes it’s
implementations of the DTO equiv. types.
</p>
        <p>
Change the project properties of the Contracts project to build to: <font face="Courier New">..\Pipeline\Contracts\</font></p>
        <p>
Also note, for types that take a dependency on the DTO project, set the Copy Local
property of the reference to False.  This is to keep the pipleline path clean. 
i.e. we don’t actually want a copy of the DTO assembly in the <font face="Courier New">\pipeline\contracts\</font> path! 
This will slow our discovery and generate warnings as the Add-In infrastructure tries
to examine it for contracts. 
</p>
        <p>
          <strong>Step 2: Host View and Add-In View<br /></strong>
          <br />
Add two new assemblies:  host view and add-in view<br />
Each has a <strong>public abstract class that mirrors the contract interface but does
not reference it</strong>.
</p>
        <p>
          <img src="http://deepdark.net/content/binary/AddInStep2.jpg" border="0" />
        </p>
        <p>
Host view does not even need a reference to <font face="Courier New">System.AddIn.</font></p>
        <p>
When building the Add-In View, be sure to:
</p>
        <ul>
          <li>
Apply <font face="Courier New">System.AddIn.Pipeline.<font color="#0000ff">AddInBaseAttribute</font></font></li>
          <li>
Set the project to build to <font face="Courier New">..\Pipeline\AddInViews\</font></li>
        </ul>
        <p>
          <strong>Step 3:  Host Adaptor and Add-In Adaptor</strong>
        </p>
        <p>
Add two more assemblies:  host adaptor and add-in adaptor
</p>
        <p>
          <img src="http://deepdark.net/content/binary/AddInStep3.jpg" border="0" />
        </p>
        <p>
Add-in adapter will have one <em>AddinToContractAdapter </em>class for each Add-In
type and the Host adapter has one <em>ContractToHostViewAdapter </em>class for
each Add-In type.
</p>
        <p>
The <em>AddinToContractAdapter</em> descends from <font face="Courier New">System.AddIn.<font color="#0000ff">ContractBase</font></font> and
implements the contract for the Add-In
</p>
        <p>
The <em>ContractToHostViewAdapter</em> descends from the Abstract class in the Host
View for the Add-In.
</p>
        <p>
Set the build output path of the Host Side adapter to:<font face="Courier New"> ..\Pipeline\HostSideAdapters\<br /></font>And set the build output path of the Add-In Side adapter to: <font face="Courier New">..\Pipeline\AddInSideAdapters\</font></p>
        <p>
The purpose of these adapters is too marshal calls between the instances of your <font face="Courier New">I<em>Contract</em></font>'s
and should just look like wrapper code.
</p>
        <p>
          <strong>Step 4: Build the Add-Ins</strong>
        </p>
        <p>
Every Add-In needs to take a dependency on the Add-In View project and the DTO project. 
Be sure to set their <font face="Courier New">Copy Local = False</font> in the reference
properties.
</p>
        <p>
Each Add-In also needs to descend from the abstract class in the Add-In View project,
implement overrides, and to be decorated with <font face="Courier New">System.AddIn.<font color="#0000ff">AddInAttribute</font></font>.
</p>
        <p>
The AddIn Attribute is the key to how the Add-In will be seen by the host so pay attention
to the parameters on the constructor.
</p>
        <p>
Set the build output path of each Add-In to: <font face="Courier New" color="#000000">..\Pipeline\AddIns\<em>&lt;addinName&gt;</em>\</font></p>
        <p>
I should mention that the Add-In's in the sample code below are just stubs to
show the complete loop.  The Book Library Add-In returns empty objects of the
prescribed types, the other two throw an Exception.  This is to show error handling.
</p>
        <p>
          <strong>Step 5:  The Add-In Host</strong>
        </p>
        <p>
Take a reference to the Host View and Dto projects, this time it is OK to have the
reference Copy Local.
</p>
        <p>
In the attached example the Book Library add-in returns empty objects of the designed
type, however the other two (DVD Library and CD Library) throw an Exception for each
operation.  
</p>
        <p>
By the end of the process, the project will look like this: 
</p>
        <p>
          <br />
          <img src="http://deepdark.net/content/binary/AddInStep4.jpg" border="0" />
        </p>
        <p>
          <strong>Trouble shooting &amp; Error Handling</strong>
        </p>
        <p>
Just skiming over this topic, but it is wise to wire up a handler to <font face="Courier New"><font color="#0000ff">AppDomain</font>.UnhandledException</font> for
the app domain that will run your Add-Ins, and <font face="Courier New"><font color="#0000ff">Application</font>.ThreadException</font> (Windows
Forms examples) as well as wrapping calls into the Add-In with a Try... Catch block.  
</p>
        <p>
If you are trying to work out why your AddIns are not being discovered, remember that:
</p>
        <ul>
          <li>
            <font face="Courier New">
              <font color="#0000ff">AddInStore</font>.Rebuild()</font>
          </li>
          <li>
            <font face="Courier New">
              <font color="#0000ff">AddInStore</font>.RebuildAddIns()</font>
          </li>
          <li>
            <font face="Courier New">
              <font color="#0000ff">AddInStore</font>.Update() </font>
          </li>
          <li>
            <font face="Courier New">
              <font color="#0000ff">AddInStore</font>.UpdateAddIns()</font>
          </li>
        </ul>
        <p>
...all return an array of strings that can be examined to determine how the AddIn
discovery went.
</p>
        <p>
          <strong>Source Code:</strong>
        </p>
        <p>
The source code for this example is available for download from the following link:
</p>
        <p>
          <a href="http://deepdark.net/content/binary/LibraryAddInDemoCode_deepdark.net.zip">LibraryAddInDemoCode_deepdark.net.zip
(152.81 KB)</a>
        </p>
        <p>
It requires Visual Studio Codename Orcas Beta 1.
</p>
        <p>
          <strong>Summary:</strong>
        </p>
        <p>
There are a couple of steps to implementing the new System.Addin stuff, but none of
it is hard!
</p>
        <p>
...and considering that it replaces a lot of very untidy and error-prone Reflection
code that we had to do in prior versions of the framework I think this is a great
addition to the toolbox.
</p>
        <p>
This post is not meant to be a hardcore reference, just the total of my experience
with this technology to date.  If you have any feedback please don't hesitate
to contact me by email or leaving a comment on this post.
</p>
        <p>
          <strong>Sources</strong>:
</p>
        <ul>
          <li>
            <a href="http://blogs.msdn.com/clraddins/">CLR Add-In Team's blog</a>
          </li>
          <li>
Jason He's <em>CLR AddIn Model in Paint.Net</em> series [<a href="http://blogs.msdn.com/zifengh/archive/2007/01/04/addin-model-in-paint-net-1-introduction.aspx">1</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/05/addin-model-in-paint-net-2-addin-discovery.aspx">2</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/08/addin-model-in-paint-net-3-host-side-view.aspx">3</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/09/addin-model-in-paint-net-4-contract-and-hostadapter.aspx">4</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/10/addin-model-in-paint-net-5-icontract-contractbase-and-addinadapter.aspx">5</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/12/addin-model-in-paint-net-6-addinbase-addin-and-deployment.aspx">6</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/15/addin-model-in-paint-net-7-addin-activation.aspx">7</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/16/addin-model-in-paint-net-7-addincontroller.aspx">8</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/18/addin-model-in-paint-net-9-lifetimetoken-and-lifetimetokenhandle.aspx">9</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/24/clr-addin-model-in-paint-net-10-data-type-contract.aspx">10</a>]
[<a href="http://blogs.msdn.com/zifengh/archive/2007/01/29/clr-addin-model-in-paint-net-11-addin-side-data-type-adapters.aspx">11</a>]</li>
        </ul>
        <p>
          <strong>
            <font color="#808080">Listening to: The Chillout Sessions 3</font>
          </strong>
        </p>
      </body>
      <title>Everything you need to know to get started with System.AddIn (...Plus sample code!)</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,e52bc16e-8863-4f99-97e8-9c1daa675a05.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,e52bc16e-8863-4f99-97e8-9c1daa675a05.aspx</link>
      <pubDate>Thu, 12 Jul 2007 07:18:15 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;How to start?&lt;/strong&gt;
&lt;br&gt;
You will need several assemblies.&amp;nbsp; This is because to reach the level of decoupling
that is desired, the pipeline has a certain pattern of dependencies between projects.&amp;nbsp;
I’m not sure if I am subconsciously not objecting to it or actually actively like
this now, was not always the way.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;A pipeline?&lt;/strong&gt;
&lt;br&gt;
Yes, you need one.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;What is a pipeline?&lt;/strong&gt;
&lt;br&gt;
It’s a series of folders that live somewhere&amp;nbsp;(does not have to be under your
application's path)&amp;nbsp;and each of the assemblies have their place in the structure.&amp;nbsp;
The folders will look like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://deepdark.net/content/binary/Add-InPipeLinePaths1.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
It’s probably a good idea to build one now in your project tree and set the build
output as you go.
&lt;/p&gt;
&lt;p&gt;
There is a &lt;a href="http://blogs.msdn.com/clraddins/archive/2007/02/23/brief-introduction-to-our-architecture-for-managed-add-ins.aspx"&gt;graphic
explaining the pipeline on the CLR Add-In team blog&lt;/a&gt; (with nice colours), it is
also in the Orcas MSDN under the title: "Pipeline Development Requirements".&amp;nbsp;
The MSDN one has the addition of lines to indicate the static dependancies. 
&lt;/p&gt;
&lt;p&gt;
I've chosen to show it differently in my graphics&amp;nbsp;&lt;font color=#a9a9a9 size=1&gt;(don't
say a word!)&lt;/font&gt; to indicate the order of it all coming together as well as the
references.&amp;nbsp; In the graphic the &lt;strong&gt;&lt;em&gt;arrow lines illustrate the dependancies
between the projects&lt;/em&gt;&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Also, I make reference to the sample code throughout this post.&amp;nbsp; Download link
is at the bottom.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Step 1: Define Contracts &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The first step is to define the contracts in your contracts assembly and &lt;a href="http://en.wikipedia.org/wiki/Data_Transfer_Object"&gt;DTOs
in your DTO’s assembly&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Your contract should be one interface per kind of add-in you will support.&amp;nbsp; These
interfaces need to inherit &lt;font face="Courier New"&gt;System.AddIn.Contract.&lt;font color=#0000ff&gt;IContract&lt;/font&gt;&lt;/font&gt; and
be decorated with &lt;font face="Courier New"&gt;System.AddIn.Pipeline.&lt;font color=#0000ff&gt;AddInContractAttribute&lt;/font&gt;&lt;/font&gt;.
&lt;/p&gt;
&lt;p&gt;
Types in the DTO that you wish to pass over the boundary will need to be serializable.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://deepdark.net/content/binary/AddInStep0.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Jason He’s example of a Paint.NET Add-In (link below)&amp;nbsp;takes a different path,
by adding the extra types in the Add-In View, adding more wrappers.&amp;nbsp; His approach
may have advantages that I have not discovered yet, but it reminds me of some of the
dancing you have to do when for example you have the same type in a Web Reference
and a binary reference in the same project.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
My preference is then to make a behavior-free separate assembly that anyone can take
a dependency on safely.&amp;nbsp; This is the reason for including a DTO project.&amp;nbsp;
I also like having the DTO types there to do as a [DataContract] does in WCF.&amp;nbsp;
This will allow the Add-In contract to remain static if the host side changes it’s
implementations of the DTO equiv. types.
&lt;/p&gt;
&lt;p&gt;
Change the project properties of the Contracts project to build to: &lt;font face="Courier New"&gt;..\Pipeline\Contracts\&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Also note, for types that take a dependency on the DTO project, set the Copy Local
property of the reference to False.&amp;nbsp; This is to keep the pipleline path clean.&amp;nbsp;
i.e. we don’t actually want a copy of the DTO assembly in the &lt;font face="Courier New"&gt;\pipeline\contracts\&lt;/font&gt; path!&amp;nbsp;
This will slow our discovery and generate warnings as the Add-In infrastructure tries
to examine it for contracts. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Step 2: Host View and Add-In View&lt;br&gt;
&lt;/strong&gt;
&lt;br&gt;
Add two new assemblies:&amp;nbsp; host view and add-in view&lt;br&gt;
Each has a &lt;strong&gt;public abstract class that mirrors the contract interface but does
not reference it&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://deepdark.net/content/binary/AddInStep2.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Host view does not even need a reference to &lt;font face="Courier New"&gt;System.AddIn.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
When building the Add-In View, be sure to:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Apply &lt;font face="Courier New"&gt;System.AddIn.Pipeline.&lt;font color=#0000ff&gt;AddInBaseAttribute&lt;/font&gt;&lt;/font&gt; 
&lt;li&gt;
Set the project to build to &lt;font face="Courier New"&gt;..\Pipeline\AddInViews\&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Step 3:&amp;nbsp; Host Adaptor and Add-In Adaptor&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Add two more assemblies:&amp;nbsp; host adaptor and add-in adaptor
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://deepdark.net/content/binary/AddInStep3.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Add-in adapter will have&amp;nbsp;one &lt;em&gt;AddinToContractAdapter &lt;/em&gt;class for each Add-In
type and the Host adapter has&amp;nbsp;one &lt;em&gt;ContractToHostViewAdapter &lt;/em&gt;class for
each Add-In type.
&lt;/p&gt;
&lt;p&gt;
The &lt;em&gt;AddinToContractAdapter&lt;/em&gt; descends from &lt;font face="Courier New"&gt;System.AddIn.&lt;font color=#0000ff&gt;ContractBase&lt;/font&gt;&lt;/font&gt; and
implements the contract for the Add-In
&lt;/p&gt;
&lt;p&gt;
The &lt;em&gt;ContractToHostViewAdapter&lt;/em&gt; descends from the Abstract class in the Host
View for the Add-In.
&lt;/p&gt;
&lt;p&gt;
Set the build output path of the&amp;nbsp;Host Side adapter to:&lt;font face="Courier New"&gt; ..\Pipeline\HostSideAdapters\&lt;br&gt;
&lt;/font&gt;And set the build output path of the Add-In Side adapter to: &lt;font face="Courier New"&gt;..\Pipeline\AddInSideAdapters\&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
The purpose of these adapters is too marshal calls between the instances of your &lt;font face="Courier New"&gt;I&lt;em&gt;Contract&lt;/em&gt;&lt;/font&gt;'s
and should just look like wrapper code.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Step 4: Build the Add-Ins&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Every Add-In needs to take a dependency on the Add-In View project and the DTO project.&amp;nbsp;
Be sure to set their &lt;font face="Courier New"&gt;Copy Local = False&lt;/font&gt; in the reference
properties.
&lt;/p&gt;
&lt;p&gt;
Each Add-In also needs to descend from the abstract class in the Add-In View project,
implement overrides, and to be decorated with &lt;font face="Courier New"&gt;System.AddIn.&lt;font color=#0000ff&gt;AddInAttribute&lt;/font&gt;&lt;/font&gt;.
&lt;/p&gt;
&lt;p&gt;
The AddIn Attribute is the key to how the Add-In will be seen by the host so pay attention
to the parameters on the constructor.
&lt;/p&gt;
&lt;p&gt;
Set the build output path of each Add-In to: &lt;font face="Courier New" color=#000000&gt;..\Pipeline\AddIns\&lt;em&gt;&amp;lt;addinName&amp;gt;&lt;/em&gt;\&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I should mention that the Add-In's in the sample code below are just stubs&amp;nbsp;to
show the complete loop.&amp;nbsp; The Book Library Add-In returns empty objects of the
prescribed types, the other two throw an Exception.&amp;nbsp; This is to show error handling.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Step 5:&amp;nbsp; The Add-In Host&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Take a reference to the Host View and Dto projects, this time it is OK to have the
reference Copy Local.
&lt;/p&gt;
&lt;p&gt;
In the attached example the Book Library add-in returns empty objects of the designed
type, however the other two (DVD Library and CD Library) throw an Exception for each
operation.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
By the end of the process, the project will look like this: 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;img src="http://deepdark.net/content/binary/AddInStep4.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Trouble shooting &amp;amp; Error Handling&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Just skiming over this topic, but it is wise to wire up a handler to&amp;nbsp;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;AppDomain&lt;/font&gt;.UnhandledException&lt;/font&gt; for
the app domain that will run your Add-Ins, and &lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;Application&lt;/font&gt;.ThreadException&lt;/font&gt; (Windows
Forms examples) as well as wrapping calls into the Add-In with a Try... Catch block.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
If you are trying to work out why your AddIns are not being discovered, remember that:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;AddInStore&lt;/font&gt;.Rebuild()&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;AddInStore&lt;/font&gt;.RebuildAddIns()&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;AddInStore&lt;/font&gt;.Update() &lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;AddInStore&lt;/font&gt;.UpdateAddIns()&lt;/font&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
...all return an array of strings that can be examined to determine how the AddIn
discovery went.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Source Code:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The source code for this example is available for download from the following link:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://deepdark.net/content/binary/LibraryAddInDemoCode_deepdark.net.zip"&gt;LibraryAddInDemoCode_deepdark.net.zip
(152.81 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
It requires Visual Studio Codename Orcas Beta 1.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Summary:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
There are a couple of steps to implementing the new System.Addin stuff, but none of
it is hard!
&lt;/p&gt;
&lt;p&gt;
...and considering that it replaces a lot of very untidy and error-prone Reflection
code that we had to do in prior versions of the framework I think this is a great
addition to the toolbox.
&lt;/p&gt;
&lt;p&gt;
This post is not meant&amp;nbsp;to be a hardcore reference, just the total of my experience
with this technology to date.&amp;nbsp; If you have any feedback please don't hesitate
to contact me by email or leaving a comment on this post.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Sources&lt;/strong&gt;:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://blogs.msdn.com/clraddins/"&gt;CLR Add-In Team's blog&lt;/a&gt; 
&lt;li&gt;
Jason He's &lt;em&gt;CLR AddIn Model in Paint.Net&lt;/em&gt; series [&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/04/addin-model-in-paint-net-1-introduction.aspx"&gt;1&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/05/addin-model-in-paint-net-2-addin-discovery.aspx"&gt;2&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/08/addin-model-in-paint-net-3-host-side-view.aspx"&gt;3&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/09/addin-model-in-paint-net-4-contract-and-hostadapter.aspx"&gt;4&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/10/addin-model-in-paint-net-5-icontract-contractbase-and-addinadapter.aspx"&gt;5&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/12/addin-model-in-paint-net-6-addinbase-addin-and-deployment.aspx"&gt;6&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/15/addin-model-in-paint-net-7-addin-activation.aspx"&gt;7&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/16/addin-model-in-paint-net-7-addincontroller.aspx"&gt;8&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/18/addin-model-in-paint-net-9-lifetimetoken-and-lifetimetokenhandle.aspx"&gt;9&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/24/clr-addin-model-in-paint-net-10-data-type-contract.aspx"&gt;10&lt;/a&gt;]
[&lt;a href="http://blogs.msdn.com/zifengh/archive/2007/01/29/clr-addin-model-in-paint-net-11-addin-side-data-type-adapters.aspx"&gt;11&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font color=#808080&gt;Listening to: The Chillout Sessions 3&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,e52bc16e-8863-4f99-97e8-9c1daa675a05.aspx</comments>
      <category>Downloads</category>
      <category>Geeking Out!</category>
      <category>Microsoft.NET</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=8bbf1058-f044-4a39-abe2-1263c4cb7dd8</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,8bbf1058-f044-4a39-abe2-1263c4cb7dd8.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,8bbf1058-f044-4a39-abe2-1263c4cb7dd8.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=8bbf1058-f044-4a39-abe2-1263c4cb7dd8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
An <a href="http://msmvps.com/blogs/brianmadsen/archive/2007/04/04/james-green-shows-talent.aspx">MVP
they call Brian</a> referred me to a new Blog/RSS Feed client called <a href="http://www.feedghost.com/ref=csharpzealot">FeedGhost</a>.
</p>
        <p>
It scratches my itch for a feed reader that can sync between multiple PCs through
a subscription service, but the most impressive feature I have found so far is the
UI.  It has set a new high water mark for me in the smartclient space.  
</p>
        <p>
Check out the screen shots - but once installed you realize the screenshots don't
do it justice.  
</p>
        <p>
The timing of this news couldn't be better for me because I was reading my feeds on
my "Beta Bliss" laptop - Vista RC1 &amp; Office 2007 Beta 2 TR, and office expired
1st of April so I was in the market for a new feed reader.  I love it when things
just come together :-)
</p>
      </body>
      <title>In need of a Feed?  FeedGhost to the rescue</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,8bbf1058-f044-4a39-abe2-1263c4cb7dd8.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,8bbf1058-f044-4a39-abe2-1263c4cb7dd8.aspx</link>
      <pubDate>Wed, 04 Apr 2007 01:06:11 GMT</pubDate>
      <description>&lt;p&gt;
An &lt;a href="http://msmvps.com/blogs/brianmadsen/archive/2007/04/04/james-green-shows-talent.aspx"&gt;MVP
they call Brian&lt;/a&gt; referred me to a new Blog/RSS Feed client called &lt;a href="http://www.feedghost.com/ref=csharpzealot"&gt;FeedGhost&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
It scratches my itch for a feed reader that can sync between multiple PCs through
a subscription service, but the most impressive feature I have found so far is the
UI.&amp;nbsp; It has set a new high water mark for me in the smartclient space.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Check out the screen shots - but once installed you realize the screenshots don't
do it justice.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
The timing of this news couldn't be better for me because I was reading my feeds on
my "Beta Bliss" laptop - Vista RC1 &amp;amp; Office 2007 Beta 2 TR, and office expired
1st of April so I was in the market for a new feed reader.&amp;nbsp; I love it when things
just come together :-)
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,8bbf1058-f044-4a39-abe2-1263c4cb7dd8.aspx</comments>
      <category>Downloads</category>
      <category>Geeking Out!</category>
      <category>MLP</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=9f7fd404-796e-4353-a954-d8fcd8465cd4</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,9f7fd404-796e-4353-a954-d8fcd8465cd4.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,9f7fd404-796e-4353-a954-d8fcd8465cd4.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=9f7fd404-796e-4353-a954-d8fcd8465cd4</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>More different ways to script database objects a different way</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,9f7fd404-796e-4353-a954-d8fcd8465cd4.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,9f7fd404-796e-4353-a954-d8fcd8465cd4.aspx</link>
      <pubDate>Wed, 21 Feb 2007 07:32:28 GMT</pubDate>
      <description>Rob Farley posted a &lt;a href="http://msmvps.com/blogs/robfarley/archive/2007/02/21/scripting-database-objects-a-different-way.aspx"&gt;very
interesting codegen post on scripting objects this morning&lt;/a&gt;, and as a reforming
codegen junky I just couldn't let it go without comment :-) 
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
Firstly, I modified his query as so:&lt;br&gt;
&lt;pre&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;select &lt;/font&gt;&lt;font color=#ff1493&gt;quotename&lt;/font&gt;(si&lt;font color=#0000ff&gt;.&lt;/font&gt;&lt;font color=#0000ff&gt;name) &lt;/font&gt;&lt;font color=#0000ff&gt;as &lt;/font&gt;"@IndexName", &lt;font color=#ff1493&gt;quotename&lt;/font&gt;(ss.&lt;font color=#0000ff&gt;name&lt;/font&gt;) &lt;font color=#0000ff&gt;AS &lt;/font&gt;"@SchemaName", &lt;font color=#ff1493&gt;quotename&lt;/font&gt;(so.&lt;font color=#0000ff&gt;name&lt;/font&gt;) &lt;font color=#0000ff&gt;AS &lt;/font&gt;"@ObjectName",&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#ff1493&gt;stuff&lt;/font&gt;((&lt;font color=#0000ff&gt;select &lt;/font&gt;&lt;font color=#ff0000&gt;','&lt;/font&gt; + &lt;font color=#ff1493&gt;quotename&lt;/font&gt;(sc.&lt;font color=#0000ff&gt;name&lt;/font&gt;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;from &lt;/font&gt;&lt;font color=#008000&gt;sys.index_columns&lt;/font&gt; sic&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#808080&gt;join &lt;/font&gt;&lt;font color=#008000&gt;sys.columns&lt;/font&gt; sc&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;on &lt;/font&gt;sc.column_id
= sic.column_id&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;where &lt;/font&gt;so.&lt;font color=#ff1493&gt;object_id&lt;/font&gt; =
sic.&lt;font color=#ff1493&gt;object_id&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#808080&gt;and &lt;/font&gt;sic.index_id
= si.index_id&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#808080&gt;and &lt;/font&gt;sc.&lt;font color=#ff1493&gt;object_id &lt;/font&gt;=
so.&lt;font color=#ff1493&gt;object_id&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;order
by&lt;/font&gt; sic.key_ordinal&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;for xml
path&lt;/font&gt;(&lt;font color=#ff0000&gt;''&lt;/font&gt;)),1,1,&lt;font color=#ff0000&gt;''&lt;/font&gt;) &lt;font color=#0000ff&gt;as &lt;/font&gt;"@IndexColumns"&lt;br&gt;
&lt;font color=#0000ff&gt;from &lt;/font&gt;&lt;font color=#008000&gt;sys.indexes&lt;/font&gt; si&lt;br&gt;
&lt;font color=#808080&gt;join &lt;/font&gt;&lt;font color=#008000&gt;sys.objects&lt;/font&gt; so&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; on so.&lt;font color=#ff1493&gt;object_id&lt;/font&gt; = si.&lt;font color=#ff1493&gt;object_id&lt;/font&gt;
&lt;br&gt;
&lt;font color=#808080&gt;join &lt;/font&gt;&lt;font color=#008000&gt;sys.schemas&lt;/font&gt; ss&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;on &lt;/font&gt;ss.schema_id = so.schema_id&lt;br&gt;
&lt;font color=#0000ff&gt;where &lt;/font&gt;so.&lt;font color=#0000ff&gt;type &lt;/font&gt;= &lt;font color=#ff0000&gt;'U'&lt;/font&gt; &lt;font color=#808080&gt;and &lt;/font&gt;si.&lt;font color=#0000ff&gt;type &lt;/font&gt;=
1&lt;br&gt;
&lt;font color=#0000ff&gt;for xml path&lt;/font&gt;(&lt;font color=#ff0000&gt;'index'&lt;/font&gt;), &lt;font color=#0000ff&gt;root&lt;/font&gt;(&lt;font color=#ff0000&gt;'indexes'&lt;/font&gt;)&lt;/font&gt;
&lt;br&gt;
&lt;/pre&gt;
&lt;br&gt;
Things I'll point out:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Adding the extra &lt;font face="Courier New"&gt;for xml &lt;/font&gt;clause, this time specifying
a better row element name than 'row' and also adding a document node 
&lt;br&gt;
&lt;li&gt;
Once the outter for xml clause is in place, we can alias the columns using @ to have
them come out as elements in the results&lt;/li&gt;
&lt;/ul&gt;
We can feed the results of that query straight into the following XSLT:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;font face="Courier New"&gt;&amp;lt;?&lt;font color=#a52a2a&gt;xml&lt;/font&gt; &lt;font color=#ff0000&gt;version&lt;/font&gt;=&lt;font color=#006400&gt;"1.0"&lt;/font&gt; &lt;font color=#ff0000&gt;encoding&lt;/font&gt;=&lt;font color=#006400&gt;"iso-8859-1"&lt;/font&gt;&lt;font color=#a52a2a&gt;?&lt;/font&gt;&amp;gt;&lt;br&gt;
&amp;lt;&lt;font color=#0000ff&gt;xsl:stylesheet&lt;/font&gt; &lt;font color=#ff0000&gt;version&lt;/font&gt;=&lt;font color=#006400&gt;"1.0"&lt;/font&gt; &lt;font color=#ff0000&gt;xmlns:xsl&lt;/font&gt;=&lt;font color=#006400&gt;"http://www.w3.org/1999/XSL/Transform"&lt;/font&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;font color=#0000ff&gt;xsl:output&lt;/font&gt; &lt;font color=#ff0000&gt;method&lt;/font&gt;="&lt;font color=#006400&gt;text"&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;font color=#0000ff&gt;xsl:template&lt;/font&gt; &lt;font color=#ff0000&gt;match&lt;/font&gt;=&lt;font color=#006400&gt;'/'&lt;/font&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;font color=#0000ff&gt;xsl:apply-templates&lt;/font&gt; &lt;font color=#ff0000&gt;select &lt;/font&gt;=&lt;font color=#006400&gt;'indexes/index'&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;font color=#0000ff&gt;xsl:template&lt;/font&gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp; &amp;lt;&lt;font color=#0000ff&gt;xsl:template&lt;/font&gt; &lt;font color=#ff0000&gt;match&lt;/font&gt;=&lt;font color=#006400&gt;'index'&lt;/font&gt; &amp;gt;&lt;br&gt;
create index &amp;lt;&lt;font color=#0000ff&gt;xsl:value-of&lt;/font&gt; &lt;font color=#ff0000&gt;select&lt;/font&gt;=&lt;font color=#006400&gt;'@IndexName'&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt; 
&lt;br&gt;
&amp;nbsp; on &amp;lt;&lt;font color=#0000ff&gt;xsl:value-of&lt;/font&gt; &lt;font color=#ff0000&gt;select&lt;/font&gt;=&lt;font color=#006400&gt;'@SchemaName'&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt;.&amp;lt;&lt;font color=#0000ff&gt;xsl:value-of&lt;/font&gt; &lt;font color=#ff0000&gt;select&lt;/font&gt;=&lt;font color=#006400&gt;'@ObjectName'&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt;
(&amp;lt;&lt;font color=#0000ff&gt;xsl:value-of&lt;/font&gt; &lt;font color=#ff0000&gt;select&lt;/font&gt;=&lt;font color=#006400&gt;'@IndexColumns'&lt;/font&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;&amp;gt;)&lt;br&gt;
&amp;nbsp; &amp;lt;/&lt;font color=#0000ff&gt;xsl:template&lt;/font&gt;&amp;gt;&lt;br&gt;
&amp;nbsp; 
&lt;br&gt;
&amp;lt;&lt;font color=#0000ff&gt;/xsl:stylesheet&lt;/font&gt;&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;/pre&gt;
&lt;p class=MsoNormal&gt;
I'm not claiming this method is superior, just different, which I think is in keeping
with the spirit of Rob's post :-)&amp;nbsp; and I have learned more about the improvements
of the for xml clause in SQL Server 2005 in the process.&lt;br&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I'll leave final judgment on the utility of this approach as an exercise to the reader;
my instinctive reaction is to include it as a build step to help you snapshot schema
changes between check-ins, or as Rob suggests to take objects from one database and
create slightly different objects in another database – there are no wrong answers
and if you think of something interesting please leave a comment :-)&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;?xml:namespace prefix = o /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
Grab the source files here: &lt;a href="http://deepdark.net/content/binary/ScriptObjects.zip"&gt;ScriptObjects.zip
(.78 KB)&lt;/a&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,9f7fd404-796e-4353-a954-d8fcd8465cd4.aspx</comments>
      <category>Code Generation</category>
      <category>Database</category>
      <category>Downloads</category>
      <category>T-SQL</category>
      <category>XSLT</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=b80874f5-1733-4711-8189-d8e0ab608ae7</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,b80874f5-1733-4711-8189-d8e0ab608ae7.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,b80874f5-1733-4711-8189-d8e0ab608ae7.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=b80874f5-1733-4711-8189-d8e0ab608ae7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just thought it would be more sense to provide a link to the files mentioned in
my last post.  <a href="http://deepdark.net/files/deepdark.net_xslt_samples.zip">Grab
them if you are interested</a>.
</p>
      </body>
      <title>Just a little bit more XSLT (the files)</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,b80874f5-1733-4711-8189-d8e0ab608ae7.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,b80874f5-1733-4711-8189-d8e0ab608ae7.aspx</link>
      <pubDate>Tue, 14 Nov 2006 22:45:46 GMT</pubDate>
      <description>&lt;p&gt;
I just thought it would be more sense to provide a link to the files mentioned in
my last post.&amp;nbsp; &lt;a href="http://deepdark.net/files/deepdark.net_xslt_samples.zip"&gt;Grab
them if you are interested&lt;/a&gt;.
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,b80874f5-1733-4711-8189-d8e0ab608ae7.aspx</comments>
      <category>Downloads</category>
      <category>Geeking Out!</category>
      <category>XSLT</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=e0d41aab-6f81-47ea-9681-7c7309bab953</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,e0d41aab-6f81-47ea-9681-7c7309bab953.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,e0d41aab-6f81-47ea-9681-7c7309bab953.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=e0d41aab-6f81-47ea-9681-7c7309bab953</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Hows that for a long title?  
<br /><br />
So there is a new version of Visual Studio (in <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4014554e-903a-4a62-b429-2b027321c32d&amp;DisplayLang=en">CTP
at time of writing</a>) called <a href="http://msdn.microsoft.com/vstudio/teamsystem/dbpro/">Visual
Studio Team Edition for Database Professionals</a> - its aimed at people who might
associate themselves with the title Database Professional.  I gotta say, it looks
like a really good solution to some problems.<br /><br />
I attended a cabana session at <a href="http://www.microsoft.com/australia/teched2006/">Tech.Ed
(Tech.James?) this year</a> hosted by <a href="http://www.sqldownunder.com/">Greg
Low</a> on data generation in the product, and during the presentation it came up
that it would be nice to have custom generator for Australian-specific data... so
I thought I'd take a stab at it.<br /><br />
Below is a screencap of the kind of random data my generator will spit out. 
Handy for columns where a check constraint may be forcing a given format for the data. 
The format of the phone numbers is configurable by a property and the rows are conistant
for a location so that if we generate a Vic address it will have a valid Vic phone
number etc.<br /><br /><img src="http://deepdark.net/files/datagen.jpg" /><br /><br />
The good news is its really easy to do.  Even at this early stage the product
has some pretty reasonable doco on what to do to write your own generators.<br /><br /><a href="http://deepdark.net/files/AustralianDetails_20060829.zip">So my custom generator
is available for download by clicking on this link</a><br /><br />
To install it on your copy of vsdbpro: 
<br /><ol><li>
Copy the DLL from that zip into the following path on your PC: <br /><font face="Courier New" color="#000000">[Program Files]\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\</font></li><li>
Edit the config file at: 
<br /><font face="Courier New" color="#000000">[Program Files]\Microsoft Visual Studio 8\DBPro\Microsoft.VisualStudio.TeamSystem.Data.Extensions.xml</font> with
a suitable XML editor and add the following line: 
<br /><font face="Courier New" color="#000000">&lt;type&gt;deepdark.net.PersonalDetails,
AustralianDetails, Version=1.0.0.0, Culture=neutral, PublicKeyToken=341d0bd35c6f7d28&lt;/type&gt;</font><br /></li><li>
Restart Visual Studio, you should see a new generator called Personal Details in the
list.<br /></li></ol><br />
The source code is hardly going to start a revolutiuon, but I can make it available
if there is any interest - just let me know.<br /></body>
      <title>Custom Australian Data Generator for Visual Studio Team Edition for DB Pros</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,e0d41aab-6f81-47ea-9681-7c7309bab953.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,e0d41aab-6f81-47ea-9681-7c7309bab953.aspx</link>
      <pubDate>Thu, 31 Aug 2006 23:16:57 GMT</pubDate>
      <description>Hows that for a long title?&amp;nbsp; &lt;br&gt;
&lt;br&gt;
So there is a new version of Visual Studio (in &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4014554e-903a-4a62-b429-2b027321c32d&amp;amp;DisplayLang=en"&gt;CTP
at time of writing&lt;/a&gt;) called &lt;a href="http://msdn.microsoft.com/vstudio/teamsystem/dbpro/"&gt;Visual
Studio Team Edition for Database Professionals&lt;/a&gt; - its aimed at people who might
associate themselves with the title Database Professional.&amp;nbsp; I gotta say, it looks
like a really good solution to some problems.&lt;br&gt;
&lt;br&gt;
I attended a cabana session at &lt;a href="http://www.microsoft.com/australia/teched2006/"&gt;Tech.Ed
(Tech.James?) this year&lt;/a&gt; hosted by &lt;a href="http://www.sqldownunder.com/"&gt;Greg
Low&lt;/a&gt; on data generation in the product, and during the presentation it came up
that it would be nice to have custom generator for Australian-specific data... so
I thought I'd take a stab at it.&lt;br&gt;
&lt;br&gt;
Below is a screencap of the kind of random data my generator will spit out.&amp;nbsp;
Handy for columns where a check constraint may be forcing a given format for the data.&amp;nbsp;
The format of the phone numbers is configurable by a property and the rows are conistant
for a location so that if we generate a Vic address it will have a valid Vic phone
number etc.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://deepdark.net/files/datagen.jpg"&gt;
&lt;br&gt;
&lt;br&gt;
The good news is its really easy to do.&amp;nbsp; Even at this early stage the product
has some pretty reasonable doco on what to do to write your own generators.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://deepdark.net/files/AustralianDetails_20060829.zip"&gt;So my custom generator
is available for download by clicking on this link&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
To install it on your copy of vsdbpro: 
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Copy the DLL from that zip into the following path on your PC:&amp;nbsp;&lt;br&gt;
&lt;font face="Courier New" color=#000000&gt;[Program Files]\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\&lt;/font&gt; 
&lt;li&gt;
Edit the config file at: 
&lt;br&gt;
&lt;font face="Courier New" color=#000000&gt;[Program Files]\Microsoft Visual Studio 8\DBPro\Microsoft.VisualStudio.TeamSystem.Data.Extensions.xml&lt;/font&gt; with
a suitable XML editor and add the following line: 
&lt;br&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;lt;type&amp;gt;deepdark.net.PersonalDetails, AustralianDetails,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=341d0bd35c6f7d28&amp;lt;/type&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;li&gt;
Restart Visual Studio, you should see a new generator called Personal Details in the
list.&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
The source code is hardly going to start a revolutiuon, but I can make it available
if there is any interest - just let me know.&lt;br&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,e0d41aab-6f81-47ea-9681-7c7309bab953.aspx</comments>
      <category>Database</category>
      <category>Downloads</category>
      <category>Geeking Out!</category>
      <category>Australian Data Generator for DB Pros</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=7c2cd295-1013-4419-ab4e-607195406a87</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,7c2cd295-1013-4419-ab4e-607195406a87.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,7c2cd295-1013-4419-ab4e-607195406a87.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=7c2cd295-1013-4419-ab4e-607195406a87</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Just a quick note... 
<br /><br />
Adobe Acrobat reader is slow... <a href="http://www.foxitsoftware.com/pdf/rd_intro.php">FoxIt
Reader is Fast</a>.  
<br /><br />
Nothing in it for me, just sharing the good vibes :)  Thank you FoxIt<br /><p></p></body>
      <title>Speed is of the essence</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,7c2cd295-1013-4419-ab4e-607195406a87.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,7c2cd295-1013-4419-ab4e-607195406a87.aspx</link>
      <pubDate>Tue, 15 Aug 2006 11:06:44 GMT</pubDate>
      <description>Just a quick note... &lt;br&gt;
&lt;br&gt;
Adobe Acrobat reader is slow... &lt;a href="http://www.foxitsoftware.com/pdf/rd_intro.php"&gt;FoxIt
Reader is Fast&lt;/a&gt;.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Nothing in it for me, just sharing the good vibes :)&amp;nbsp; Thank you FoxIt&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,7c2cd295-1013-4419-ab4e-607195406a87.aspx</comments>
      <category>Downloads</category>
      <category>MLP</category>
    </item>
    <item>
      <trackback:ping>http://deepdark.net/Trackback.aspx?guid=83cf6a53-71d3-4575-9b56-fe9cf2c76adf</trackback:ping>
      <pingback:server>http://deepdark.net/pingback.aspx</pingback:server>
      <pingback:target>http://deepdark.net/PermaLink,guid,83cf6a53-71d3-4575-9b56-fe9cf2c76adf.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://deepdark.net/CommentView,guid,83cf6a53-71d3-4575-9b56-fe9cf2c76adf.aspx</wfw:comment>
      <wfw:commentRss>http://deepdark.net/SyndicationService.asmx/GetEntryCommentsRss?guid=83cf6a53-71d3-4575-9b56-fe9cf2c76adf</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
Tracking stray connections using profiler<b>.  </b>Times when this can come into
play is in multithreaded apps, or apps where you may be supporting simultanious users
like in an ASP.NET application.  
<br /></p>
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
 
</p>
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
Generally any time you are asking resources from the server it should be using the <b>Try...
Catch... Finally</b> pattern for allocating server resources and releasing them as
soon as you know you can do without them.  (Nod to Andy Rich on <a href="http://blogs.msdn.com/arich/archive/2004/09/23/233683.aspx"><font size="-1">Deterministic
Finalization</font></a>)<br /></p>
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
          <br />
One thing that is going to help with this however is to set the appname in your connection
string <font face="Courier New">(Application Name={1};)</font> for filtering the Profiler
results.<br /></p>
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
          <br />
So here is a Profiler trace useful for keeping an eye logins, logouts and stored procs
executed inbetween:
</p>
        <br />
        <p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB">
Download: <a href="http://deepdark.net/images/deepdark.net_Connection_Monitor_20060112.zip">deepdark.net_Connection_Monitor_20060112.zip<br /></a></p>
      </body>
      <title>Tracking stray connections using profiler</title>
      <guid isPermaLink="false">http://deepdark.net/PermaLink,guid,83cf6a53-71d3-4575-9b56-fe9cf2c76adf.aspx</guid>
      <link>http://deepdark.net/PermaLink,guid,83cf6a53-71d3-4575-9b56-fe9cf2c76adf.aspx</link>
      <pubDate>Wed, 11 Jan 2006 13:45:32 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
Tracking stray connections using profiler&lt;b&gt;.&amp;nbsp; &lt;/b&gt;Times when this can come into
play is in multithreaded apps, or apps where you may be supporting simultanious users
like in an ASP.NET application.&amp;nbsp; 
&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
Generally any time you are asking resources from the server it should be using the &lt;b&gt;Try...
Catch... Finally&lt;/b&gt; pattern for allocating server resources and releasing them as
soon as you know you can do without them.&amp;nbsp; (Nod to Andy Rich on &lt;a href="http://blogs.msdn.com/arich/archive/2004/09/23/233683.aspx"&gt;&lt;font size="-1"&gt;Deterministic
Finalization&lt;/font&gt;&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
&lt;br&gt;
One thing that is going to help with this however is to set the appname in your connection
string &lt;font face="Courier New"&gt;(Application Name={1};)&lt;/font&gt; for filtering the Profiler
results.&lt;br&gt;
&lt;/p&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
&lt;br&gt;
So here is a Profiler trace useful for keeping an eye logins, logouts and stored procs
executed inbetween:
&lt;/p&gt;
&lt;br&gt;
&lt;p style="margin: 0in; font-family: Verdana; font-size: 10pt;" lang="EN-GB"&gt;
Download: &lt;a href="http://deepdark.net/images/deepdark.net_Connection_Monitor_20060112.zip"&gt;deepdark.net_Connection_Monitor_20060112.zip&lt;br&gt;
&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://deepdark.net/CommentView,guid,83cf6a53-71d3-4575-9b56-fe9cf2c76adf.aspx</comments>
      <category>Downloads</category>
      <category>Geeking Out!</category>
    </item>
  </channel>
</rss>