<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>MsBuild</title>
        <link>http://geekswithblogs.net/michaelstephenson/category/5446.aspx</link>
        <description>MsBuild</description>
        <language>en-GB</language>
        <copyright>Michael Stephenson</copyright>
        <managingEditor>michael_stephensonuk@yahoo.co.uk</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>I hate days like this</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/08/12/124393.aspx</link>
            <description>&lt;p&gt;Had one of those days yesterday and today, you know what its like when you find a bug/problem and you dont really get a chance to properly look at it when your doing a million things at once.&lt;/p&gt;
&lt;p&gt;It is so often that the cause of the problem is really obvious but you just cant see the wood for the trees.&lt;/p&gt;
&lt;p&gt;This is a reminder for myself as much as anything.&lt;/p&gt;
&lt;p&gt;I was writing an msbuild task to wrap cruise controls ICruiseManager so I can get the latest build label of a project that has been built.&lt;/p&gt;
&lt;p&gt;The problem was that when I tested the task using MsTest from Visual Studio it worked fine, but when I ran it from an MsBuild script it kept failing complaining about not being able to find the ThoughtWorks......Remote assembly.  I ensured that the assembly was where my tasks assembly way and frustratingly it wasnt working&lt;/p&gt;
&lt;p&gt;When my brain returned I spotted that the problem was that the assembly is being searched for in the directory which the process started (the .net framework directory where MsBuild.exe is) so by copying the assembly there it now works.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124393"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124393" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/124393.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael Stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/08/12/124393.aspx</guid>
            <pubDate>Tue, 12 Aug 2008 18:38:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/124393.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/08/12/124393.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/124393.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/124393.aspx</trackback:ping>
        </item>
        <item>
            <title>BizTalk Documenter in my build</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/08/05/124233.aspx</link>
            <description>&lt;p&gt;From previous posts you may have read how I integrated the Microsoft BizTalk documenter into my MsBuild process.&lt;/p&gt;
&lt;p&gt;In general this has been working fine, but every now and again I kept getting a build failure when trying to generate the documentation as follows:&lt;/p&gt;
&lt;p&gt;System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\&amp;lt;UserAccount&amp;gt;\Local Settings\Temp\BTS2K4Doc\Application\fb7b6ba7-016c-4a1f-9c7d-ec9037911456.html'&lt;span lang="en-gb"&gt;       &lt;/span&gt;&lt;span lang="en-gb"&gt;&lt;/span&gt;&lt;span lang="en-gb"&gt;&lt;/span&gt;&lt;span lang="en-gb"&gt;&lt;/span&gt;&lt;span lang="en-gb"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span lang="en-gb"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-gb"&gt;If you get this it seems to be caused by an hhc.exe (Microsoft Help Compiler) process still being alive from a previous run.  Just kill it and the builds will work again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-gb"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span lang="en-gb"&gt; &lt;/span&gt;
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Arial'"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Arial'"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Arial'"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div id="highlighterDivCG" style="DISPLAY: none; Z-INDEX: -1; POSITION: absolute; BACKGROUND-COLOR: yellow"&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124233"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124233" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/124233.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael Stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/08/05/124233.aspx</guid>
            <pubDate>Mon, 04 Aug 2008 23:17:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/124233.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/08/05/124233.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/124233.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/124233.aspx</trackback:ping>
        </item>
        <item>
            <title>MsBuild Task for consuming WCF Services</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/07/29/124078.aspx</link>
            <description>&lt;p&gt;Article Source: &lt;a href="http://geekswithblogs.net/michaelstephenson"&gt;http://geekswithblogs.net/michaelstephenson&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Recently at the UK SOA/BPM User Group Yossi Dahan and I chatted briefly about using MsBuild and BizTalk, more specifically Yossi mentioned that he wished it was possible to regenerate the schemas for consuming a service automatically. &lt;/p&gt;
&lt;p&gt;Following this discussion and a few other things I had a blast at seeing how difficult this would be to do. I think there is a lot of value in having this approach as it fits well with a contract based development approach and continuous integration. I want to be able to regenerate my schemas every time I build the solution, and if a breaking change has been introduced I want the solution to break so it is corrected. &lt;/p&gt;
&lt;p&gt;This fits with what I believe is a good practice to identify these kinds of problems as early as possible in the development cycle. &lt;/p&gt;
&lt;p&gt;The aims of the task are: &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Act in a similar way to the Generate Schema feature for BizTalk/Visual Studio except that it will be driven by an MsBuild task rather than a GUI &lt;/li&gt;
    &lt;li&gt;Just deal with the schemas, I wasn't too bothered about regenerating the orchestration and binding file samples &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;(The sample is available for download at the bottom of the article) &lt;/p&gt;
&lt;h1&gt;The Sample &lt;/h1&gt;
&lt;p&gt;In the sample the quickest way to demonstrate this is as follows: &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Modify the BuildProcess.xml file to point to your url for the MexEndpoint &lt;/li&gt;
    &lt;li&gt;Double click the RunBuild.cmd file &lt;/li&gt;
    &lt;li&gt;Check the Acme.BizTalk.Schemas.WCFService folder and you should see your schemas have been updated &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It is expected that you would include the schemas in your project, but exclude them from source control so they can be rebuild every time you build the solution. &lt;/p&gt;
&lt;h1&gt;Digging Deeper &lt;/h1&gt;
&lt;p&gt;I managed to work out how to do this by inspecting the Microsoft.BizTalk.Adapter.Wcf.Consuming with Reflector. Upon investigation it would have been nice if a few of the classes were externally available from the component. As it was I needed to disassemble the component to progress this idea. In the disassembled component I created a new version of the Consumer class in which I removed some of the functionality and changed the Consume method interface so it wasn't dependant on being passed a Visual Studio Project object. &lt;/p&gt;
&lt;p&gt;With a couple of other tweaks I was able to get this working &lt;/p&gt;
&lt;h1&gt;Conclusion &lt;/h1&gt;
&lt;p&gt;Although this task seems to do the job, it has not been extensively tested, and it also only currently works with the MEXEndpoint and not yet with meta data files. &lt;/p&gt;
&lt;p&gt;Hopefully this idea will help a few people, and the idea might get back to the product team as a possible future enhancement as this kind of thing can certainly help your development process be more effective.&lt;/p&gt;

&lt;embed src="http://www.box.net/static/flash/box_explorer.swf?widgetHash=3ty60p2wwg&amp;amp;cl=0" width="460" height="345" wmode="transparent" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124078"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124078" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/124078.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael Stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/07/29/124078.aspx</guid>
            <pubDate>Tue, 29 Jul 2008 00:16:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/124078.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/07/29/124078.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/124078.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/124078.aspx</trackback:ping>
        </item>
        <item>
            <title>BizTalk MsBuild Generator</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/02/16/119674.aspx</link>
            <description>&lt;p&gt;I created this tool ages ago and have been using it on projects for a while.  Ive eventually got around to cleaning it up and doing some documentation for it so I have now made it available on CodePlex.&lt;/p&gt;
&lt;p&gt;Basically the tool allows you to generate an MsBuild script which will let you do all of the build and deployment actions to compile and deploy your BizTalk solution.&lt;/p&gt;
&lt;p&gt;It also produces a script which is well structured and easy to extend.&lt;/p&gt;
&lt;p&gt;If you want to know more check out: &lt;font face="Arial"&gt;&lt;a href="http://www.codeplex.com/BizTalkMsBuildTool"&gt;http://www.codeplex.com/BizTalkMsBuildTool&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119674"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119674" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/119674.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/02/16/119674.aspx</guid>
            <pubDate>Sat, 16 Feb 2008 01:40:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/119674.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/02/16/119674.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/119674.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/119674.aspx</trackback:ping>
        </item>
        <item>
            <title>MsBuild Task for WCF Service Publishing for BizTalk</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/02/03/119245.aspx</link>
            <description>&lt;p&gt;A number of months ago I did a couple of posts about how we integrated the Soap and WSE web service publishing wizards into our build process as MsBuild tasks.  These posts are located at the following url's:&lt;/p&gt;
&lt;p&gt;Soap Adapter: &lt;font face="Arial"&gt;&lt;a href="http://geekswithblogs.net/michaelstephenson/archive/2006/09/16/91369.aspx"&gt;http://geekswithblogs.net/michaelstephenson/archive/2006/09/16/91369.aspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;WSE 2 Adapter: &lt;font face="Arial"&gt;&lt;a href="http://geekswithblogs.net/michaelstephenson/archive/2006/09/16/91371.aspx"&gt;http://geekswithblogs.net/michaelstephenson/archive/2006/09/16/91371.aspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now that BizTalk 2006 R2 is around I want to have the same approach for the WCF Publishing Wizard.&lt;/p&gt;
&lt;p&gt;Before I get into the details of this, it is important to note that WCF provides a hosting model that means you do not need to host services in IIS and they can be hosted by In Process BizTalk hosts.  Although this is cool, there are still a number of reasons you may still want to host the services in IIS.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Aim&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The aim of the task is to allow you to regenerate the services which are published as part of your build script.  This means if for example your schema changes then the published service is automatically updated for you each time you build the whole solution.  This also fits well with a continuous integration strategy.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;The development process or approach I use in these situations is as follows:&lt;/p&gt;
&lt;p&gt;1. The first time you produce the wcf service you will manually use the WCF Publishing Wizard and generate the service as desired.  &lt;/p&gt;
&lt;p&gt;2. In the published service there is a temp file called WcfServiceDescription.xml.  Take a copy of this and add it as an item to your solution.&lt;/p&gt;
&lt;p&gt;3. In your build script call the custom task we will create and pass in the path to the WcfServiceDescription.xml file in your solution.&lt;/p&gt;
&lt;p&gt;In this process it is important to note that if you need to add any new schema or orchestrations to the published service you will need to generate the service again by hand to get in there new items, and then simply overwrite the description file in your solution.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Using the task&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;The following picture shows the sample of the build script using the task.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7637/o_WCFBuildScript.png" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see above the call to the task is very simple.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Inside the Task&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;The task itself is very simple and basically references the &lt;font face="Arial"&gt;Microsoft.BizTalk.Adapter.Wcf.Publishing assembly and then executes the following code in the Execute method of the task.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7637/o_WCFTaskCode.png" /&gt;&lt;/p&gt;
&lt;p&gt;Again the code is very simple&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Things to watch for&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;There are a couple of things to watch for when you use this approach:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Ensure in the service description file you have the overwrite property set to true.  If not then if the service is already published you will get an error &lt;/li&gt;
    &lt;li&gt;I would also recomment setting up the application pool and virtual directory in IIS yourself as part of the build script.  This gives you full control over how it is created where as if you let the Wcf Service Publisher do it then it will use some default settings which you probably wouldnt want to use in practice &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I hope you file this task useful, it is a little simpler that the previous ones, particularly the WSE 2 one which unfortunately had that bug we had to work around.  If you would like to check out the sample then see below where the source code is available.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;embed src="http://www.box.net/static/flash/box_explorer.swf?widgetHash=bp5a94csoo&amp;amp;v=1&amp;amp;cl=0" width="460" height="345" type="application/x-shockwave-flash" wmode="transparent"&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Disclaimer&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have noticed a few sites that seem to copy the content of blog articles and display them in their own site.  It is a bit annoying that they do not clearly reference or acknowledge the author so I have decided to put this note on the bottom of all of my posts from now so it is clear who wrote it.&lt;/p&gt;
&lt;p&gt;This article was written by: Michael Stephenson&lt;/p&gt;
&lt;p&gt;The source of this article is: &lt;a href="http://www.geekswithblogs.net/michaelstephenson"&gt;http://www.geekswithblogs.net/michaelstephenson&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119245"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119245" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/119245.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/02/03/119245.aspx</guid>
            <pubDate>Sun, 03 Feb 2008 18:12:48 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/119245.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/02/03/119245.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/119245.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/119245.aspx</trackback:ping>
        </item>
        <item>
            <title>Integrating the BizTalk Orchestration Profiler into your MsBuild Process</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/01/29/119064.aspx</link>
            <description>&lt;p&gt;I have been wanting to include the BizTalk orchestration profiler into our build process for a while and have eventually got around to doing it.&lt;/p&gt;
&lt;p&gt;Like some of the other recent posts ive produced a simple example demonstrating this.  I will begin by discussing the example on how to use the task and then follow this with some comments on the task itself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Using the BizTalk Orchestration Profiler MsBuild Task&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The idea of the BizTalk Orchestration Profiler Task is that when my build script has ran the BizUnit tests for my BizTalk solution I want to run the Profiler to extract a report giving details of the code coverage within my orchestrations.&lt;/p&gt;
&lt;p&gt;The orchestration profiler can be ran from the command line but im not sure that you can specify more specifically which orchestrations you are interested in like you could from the Forms interface.  In addition to this it integrates nicely into my build script if I wrap the Profiler inside a custom MsBuild task.&lt;/p&gt;
&lt;p&gt;To use the task I need to know the date and time for the start date of the report.  This is important to ensure I dont pick up coverage information from previous test runs.&lt;/p&gt;
&lt;p&gt;The following demonstrates my sample build script:&lt;/p&gt;
&lt;p&gt; &lt;img height="572" alt="" width="975" src="/images/geekswithblogs_net/michaelstephenson/7618/o_BuildScript.png" /&gt;&lt;/p&gt;
&lt;p&gt; At the start of my build script I call the GetDate task to get the date and time when the build starts.  These are saved in parameters for use later in the script.  In the middle of the script I have a message which is where the calling of the BizUnit tests would be.&lt;/p&gt;
&lt;p&gt;After the tests are finished I call the Orchestration Profiler task.  In the example case I am running the report for the BizTalk.System application.  This will profile all orchestrations within this application.&lt;/p&gt;
&lt;p&gt;When the task has ran it will create the report in the place indicated by the output path and the report title.  In the above example the report produced will be placed at the following path C:\BizTalk.System Coverage Report.chm&lt;/p&gt;
&lt;p&gt;The DelayMinites attribute allows you to specify a pause before running the report to ensure all of the tracking data will be transferred to the tracking database.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Implementing the BizTalk Orchestration Profiler MsBuild Task&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;In implementing the task I have basically called the &lt;font face="Arial"&gt;Microsoft.Sdc.OrchestrationProfiler.Core assembly in the same way that the Orchestration Profiler interface does.  In addition to this I have some code which uses the &lt;font face="Arial"&gt;Microsoft.Sdc.BizTalkOM assembly to get a list of the orchestrations belonging to the application which has been supplied.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The other key point is that the profiler has a dependancy on a key in its config file indicating the path to the html help workshop.  This was going to cause a problem running this as an MsBuild task as the config setting would need to be in the MsBuild.exe.config file.  &lt;/p&gt;
&lt;p&gt;To get around this I have a method that will check for the setting and if its not there it will write the setting to the config file and refresh the section using the System.Configuration assembly.&lt;/p&gt;
&lt;p&gt;There are really the highlights of the implementation, but please refer to the sample below which contains all of the code.&lt;/p&gt;
&lt;p&gt;&lt;embed src="http://www.box.net/static/flash/box_explorer.swf?widgetHash=536mjkfksg&amp;amp;v=1&amp;amp;cl=0" width="460" height="345" type="application/x-shockwave-flash" wmode="transparent"&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Disclaimer&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have noticed a few sites that seem to copy the content of blog articles and display them in their own site.  It is a bit annoying that they do not clearly reference or acknowledge the author so I have decided to put this note on the bottom of all of my posts from now so it is clear who wrote it.&lt;/p&gt;
&lt;p&gt;This article was written by: Michael Stephenson&lt;/p&gt;
&lt;p&gt;The source of this article is: &lt;a href="http://www.geekswithblogs.net/michaelstephenson"&gt;http://www.geekswithblogs.net/michaelstephenson&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119064"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119064" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/119064.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/01/29/119064.aspx</guid>
            <pubDate>Tue, 29 Jan 2008 21:22:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/119064.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/01/29/119064.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/119064.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/119064.aspx</trackback:ping>
        </item>
        <item>
            <title>Configuring Binding Files for BizTalk</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/01/27/118963.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In all BizTalk projects you come across the old problem of configuration and how to manage the environmental settings when taking your solution from development to other environments.  The common scenario is, I work with my binding file and get my solution build and tested etc and then I take it to the testing environments or production and I need to have a new binding file or I need to manually change the settings for ports etc.  Obviously any manual steps are usually error prone so this never fully works.&lt;/p&gt;
&lt;p&gt;On our project it is not just the binding files we need to configure between environments.  The following table summarises the files that need to be configured:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table height="168" cellspacing="1" cellpadding="1" width="606" summary="" border="1"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;strong&gt;File&lt;/strong&gt;&lt;/td&gt;
            &lt;td&gt;&lt;strong&gt;Reason&lt;/strong&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;BTSNTSVC.exe.config&lt;/td&gt;
            &lt;td&gt;
            &lt;p&gt;This file contains a few simple settings which are not&lt;/p&gt;
            &lt;p&gt;held within SSO.  These need to be configured by environment&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;PolicyCache file used by BTSNTSVC.exe&lt;/td&gt;
            &lt;td&gt;
            &lt;p&gt;The policy cache contains endpoints and SPN values which are different by environment. &lt;/p&gt;
            &lt;p&gt;These are configured&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;
            &lt;p&gt;Web.config in any web services that&lt;/p&gt;
            &lt;p&gt;are published&lt;/p&gt;
            &lt;/td&gt;
            &lt;td&gt;Again there may be some values that need to be configured by environment&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;
            &lt;p&gt;PolicyCache for any published web &lt;/p&gt;
            &lt;p&gt;services&lt;/p&gt;
            &lt;/td&gt;
            &lt;td&gt;The SPN will be different by environment so this typically needs to be configured&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Binding Files&lt;/td&gt;
            &lt;td&gt;
            &lt;p&gt;We configure the binding files so that any settings which change by environment are configured.  These settings usually include:&lt;/p&gt;
            &lt;ul&gt;
                &lt;li&gt;Hosts for the ports &lt;/li&gt;
                &lt;li&gt;Endpoints &lt;/li&gt;
                &lt;li&gt;Adapter specific information &lt;/li&gt;
                &lt;li&gt;Credentials &lt;/li&gt;
                &lt;li&gt;Etc &lt;/li&gt;
            &lt;/ul&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In solving this problem i wanted to address the following requirements:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Needs to be available as an MsBuild task to integrate into the build process &lt;/li&gt;
    &lt;li&gt;Xml will be used to hold the configuration data.  This would make it easy to maintain and I could extend it by creating a tool to manage the configuration source if I wanted. &lt;/li&gt;
    &lt;li&gt;Needs to be able to produce files for multiple environments based on a template file &lt;/li&gt;
    &lt;li&gt;Needs to be able to deal with different file types such as those listed above &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;So the problem is defined above and I will explain how our solution works, and a small sample is available which demonstrates its use.&lt;/p&gt;
&lt;p&gt;The solution I developed is not BizTalk specific it can be used to configure any file.  The process that we use is as follows:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Maintain an xml file which is the source of the configuration data.  We refer to this file as the configuration dictionary.  This file defines the tags that are to be looked for, and also the real value for each environment. &lt;/li&gt;
    &lt;li&gt;For each file that is to be configured we would have a template copy of it which would contain tags where the real values are to be replaced. &lt;/li&gt;
    &lt;li&gt;In our build script we would call the MsBuild task passing in the input file and dictionary file.  We would indicate which is the desired environment and where to place the output file. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following sections will explain how we manage each of the types of file.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;BizTalk Binding Files&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;The bindings file is the most awkward to manage typically because it is the most complicated xml.  In the solution I keep a template copy which is used in the build script.  When the bindings need to be changed I do them manually in BizTalk and then export the bindings to an xml file.  I then need to manually merge the changes into the template (this can be awkward) and replace the values that need to be configured with tags which correlate to the dictionary.&lt;/p&gt;
&lt;p&gt;Whe the build script runs I configure the template for every environment I am working with and then copy them to a special folder.  This includes the binding file for the development environment.&lt;/p&gt;
&lt;p&gt;Later in the build script I use the development binding file which I created to import it to my BizTalk Application and setup my ports etc before I run my unit tests.&lt;/p&gt;
&lt;p&gt;When I deploy on another environment I can include the various binding files with the msi when it is produced, or I can import them manually.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;BTSNTSVC.exe.config &amp;amp; The Policy Cache &lt;/u&gt;&lt;/p&gt;
&lt;p&gt;As mentioned above these files also need to be configured for our overall solution.  We manage these files as a solution on their own.  This solution is setup as a project in Cruise Control.  Each time a build is produced configured versions of these files are produced for each environment.&lt;/p&gt;
&lt;p&gt;The build process for each individual application basically copies the right files to the development machine and uses them for the individual application build.&lt;/p&gt;
&lt;p&gt;When we are deploying to a given environment we can just grab the appropriate files from our Cruise Control server.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Published Web Services (web.config &amp;amp; policyCache.config)&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Because we do a lot of web service publishing we need to configure the policy cache and web.config as certain details in there files can change by environment.  We take a similar approach to the binding files where we keep templates for each as part of the solution.  We then create all of the configured versions for each environment.&lt;/p&gt;
&lt;p&gt;When we want to run tests we copy the development versions of web.config and policyCache to the right place and then run the tests.&lt;/p&gt;
&lt;p&gt;When we come to deploy to other environments we deploy the web services via the msi, but then we simply copy the appropriate environments versions of these files to the right location.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Solution Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Because we use Continuous Integration and the build process to create all of the files it allows us to produce versioned instances or all of the files that need to be configured as part of the output package from each build&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;As mentioned above I have setup a small example which goes over the core details of the solution, and I will discuss these in this section&lt;/p&gt;
&lt;p&gt;There are 2 solutions in the sample:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Arial"&gt;MsBuild.ConfigurationTask = The msbuild task and some tests for it&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Arial"&gt;MsBuild.ConfigurationTask.Example = A sample solution demonstrating its use in the build script&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Im not really going to go into the detail of the MsBuild task as the sample contains a test which should demonstrate its use.  Im going to focus on the example on how to implement it in your build.  If you have any questions about the task however feel free to drop me an email.&lt;/p&gt;
&lt;p&gt;In the example solution I have the sample input file which contains the following xml.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;
&amp;lt;SampleXml&amp;gt;&lt;br /&gt;
&amp;lt;SampleElement&amp;gt;$(BindingFilesSettings-Parameter1)&amp;lt;/SampleElement&amp;gt;&lt;br /&gt;
&amp;lt;/SampleXml&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The input file will have the $(BindingFilesSettings-Parameter1) tag replaced with a value from the dictionary.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The key points about the dictionary file are as follows:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;ul&gt;
    &lt;li&gt;It contains sections to group together similar config tags.  This makes the file easier to manage &lt;/li&gt;
    &lt;li&gt;Each tag contains a default value which is used when you choose an environment which does not have a specific setting &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the build script you will find the following task:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&amp;lt;Acme.MsBuild.Tasks.ConfigureFileBasedOnDictionary &lt;br /&gt;
   DictionaryFile = "Acme.ConfigurationDictionary.xml"&lt;br /&gt;
   Environment = "SystemTest"&lt;br /&gt;
   InputFile = "Acme.SampleBindingFile.xml"&lt;br /&gt;
   OutputFile = "ConfiguredOutput\Acme.SystemTestBindings.xml"/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This will call my custom task passing in the input and output files as required and will ensure a file is produced which is configured for the system test environment.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hopefully you will find this solution can help you on your project, if so then feel free to download the sample from below and use or amend it as you wish.  This solution has worked very well for us.  If you have any feedback or questions please feel free to comment below&lt;/p&gt;
&lt;/font&gt;
&lt;p&gt;&lt;embed src="http://www.box.net/static/flash/box_explorer.swf?widgetHash=7xsa7idssc&amp;amp;v=1&amp;amp;cl=0" width="460" height="345" type="application/x-shockwave-flash" wmode="transparent"&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;u&gt;Disclaimer&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I have noticed a few sites that seem to copy the content of blog articles and display them in their own site.  It is a bit annoying that they do not clearly reference or acknowledge the author so I have decided to put this note on the bottom of all of my posts from now so it is clear who wrote it.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This article was written by: Michael Stephenson&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The source of this article is: http://www.geekswithblogs.net/michaelstephenson&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118963"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118963" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/118963.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/01/27/118963.aspx</guid>
            <pubDate>Sun, 27 Jan 2008 17:31:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/118963.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/01/27/118963.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/118963.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/118963.aspx</trackback:ping>
        </item>
        <item>
            <title>Where have the microsoft sdc msbuild tasks gone?</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/01/25/118930.aspx</link>
            <description>&lt;p&gt;I was looking for the Microsoft Enterprise Solutions Build Framework or Microsoft.Sdc build tasks as it is sometimes known.&lt;/p&gt;
&lt;p&gt;if you google it most of the links point to gotdotnet.  I did a search on codeplex and initially didnt find it because i was looking for the wrong name.  Eventually i found it, and if anyone needs it it is located at&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;a href="http://www.codeplex.com/sdctasks"&gt;http://www.codeplex.com/sdctasks&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118930"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118930" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/118930.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/01/25/118930.aspx</guid>
            <pubDate>Fri, 25 Jan 2008 23:10:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/118930.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/01/25/118930.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/118930.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/118930.aspx</trackback:ping>
        </item>
        <item>
            <title>Generating the C# to call BizUnit Tests</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/01/19/118706.aspx</link>
            <description>&lt;div style="MARGIN: 0in 0in 0in 0.375in"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;I'm not sure about anyone else but when I come across something that is boring and repetitive I usually get around to doing some tool that minimizes the amount of time I spend doing it. In this case the task that is boring me is writing the repetitive C# code to call BizUnit to make it run your tests. I'm sure there are lots of different ways you could do this but one day when I was stuck waiting for a while at the airport I got bored and decided to do something to stop me having to do this.&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 9pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt;Aim&lt;/div&gt;
&lt;div style="FONT-SIZE: 9pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;The aim of the tool was as follows:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="1"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;Don't write anymore C# code to call BizUnit tests, I want to generate it&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="2"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;Maintain a simple list of tests which can be easily updated&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="3"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;Include the tool in the build process so that any newly added tests have the appropriate C# code created&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 9pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt;Design Decisions&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;I made the following decisions about the tool I would create:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="1"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;I decided to make an MsBuild task so it would easily plug into the build process and also regenerate the C# each time&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="2"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;I decided to use an xml list of the tests. I could have looked for files which were BizUnit tests but this would probably need to have some kind of file naming convention.&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="3"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;I wanted to wrap the call to BizUnit with a try/catch block so I could log the error to the event log. This is particularly useful when you run the tests from the command line and you don't see all of the failure details.&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ol style="MARGIN-TOP: 0in; FONT-SIZE: 11pt; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="1"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle" value="4"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The task would be easily configurable so it could use Nunit or MsTest to run the tests.&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="FONT-SIZE: 9pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt;Using the Task&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;Before I get into how I built the task I think if I explain how it is used it should seem simple and easily usable. We have used this task on a couple of projects and it has been quite handy.&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;To begin with we have the below image from the sample project. In this picture you can see the following things:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;A folder containing 3 BizUnit definition files&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The BizUnitTestDefinitions.xml file which describes the tests within the project and determines the code that will be generated.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The OverrideBuild.targets file which is imported by the project file and contains overrides for some of the build events (more on this later)&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The BizUnitTests.cs file which is the code file which gets generated&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7563/o_ProjectStructure.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;span style="FONT-SIZE: 11pt"&gt;&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in"&gt;BizUnitTestDefinitions.xml&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;As I mentioned this file is the one that describes the tests within the project. The below picture shows an example of this xml.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7563/o_TestDefinitionXml.png" /&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;The key points of the xml are as follows:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The TestGroup element allows you to group related tests. Each TestGroup will produce a class containing tests. The Name attribute will become the name of the test class.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;Each Test element will become a method which will run a test. It will be contained within the class from its associated TestGroup. The Name attribute will become the name of the test&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The BizUnitTestCasePath element will point to the file containing the details of the BizUnit test. In this case because the example project uses MsTest I have copied the BizUnit tests to the test results directory using the TestRunConfig so I dont need to worry about the path.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;OverrideBuild.targets&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;This file is imported by the project file allowing me to specify MsBuild targets to customise the projects build process. The contents of this file are below:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7563/o_OverrideBuild.png" /&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;  &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;In this file I have a target which overrides the BeforeBuild target. This is because I want to generate the class containing my tests before the project is compiled.   The key points of this file are:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The UsingTask element imports my custom MsBuild task so I can use it&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt; &lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.375in; DIRECTION: ltr; unicode-bidi: embed" type="disc"&gt;
    &lt;li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;span style="FONT-SIZE: 11pt"&gt;The use of my task in this case is set to use MsTest, but you could easily use Nunit instead by specifying the appropriate values for the TestAssemblyName, TestFixtureAttributeName and TestMethodAttributeName.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;This task will basically take these parameters and inspect the xml definition of the tests then produce the output file containing the C# code.&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;BizUnitTests.cs&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;This file contains the code which is generated. An example of some generated code is in the picture below:&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/michaelstephenson/7563/o_ExampleCSharp.png" /&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;The couple of key points to note are: &lt;/div&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;div&gt;&lt;span style="FONT-SIZE: 11pt"&gt;I have made it generate code which will log to the event log any errors to make troubleshooting easier&lt;/span&gt; &lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;div&gt;&lt;span style="FONT-SIZE: 11pt"&gt;If you use source control you might want to exclude this file from source control so it can be regenerated each time you build the project.&lt;/span&gt; &lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in; TEXT-DECORATION: underline"&gt;Summary&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;If there is any interesting feedback on this post I will probably do a follow up describing how the MsBuild task is build. In the meantime the code for the task, and also the sample project are available at the below location so you should be able to see this for yourself.&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt; &lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in 0in 0in 0.375in"&gt;&lt;a href="http://www.box.net/shared/63g7rjuo0k"&gt;http://www.box.net/shared/63g7rjuo0k&lt;/a&gt;&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;/div&gt;
&lt;div style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 0in"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;u&gt;Disclaimer&lt;/u&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;I have noticed a few sites that seem to copy the content of blog articles and display them in their own site.  It is a bit annoying that they do not clearly reference or acknowledge the author so I have decided to put this note on the bottom of all of my posts from now so it is clear who wrote it.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;This article was written by: Michael Stephenson&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;The source of this article is: http://www.geekswithblogs.net/michaelstephenson&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118706"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118706" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/118706.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/01/19/118706.aspx</guid>
            <pubDate>Sat, 19 Jan 2008 23:05:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/118706.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/01/19/118706.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/118706.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/118706.aspx</trackback:ping>
        </item>
        <item>
            <title>Problem resuming an orchestration with WMI</title>
            <link>http://geekswithblogs.net/michaelstephenson/archive/2008/01/15/118544.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I recently had to make a change to one of out orchestrations on a BizTalk project.  The change was that we needed to in a certain case suspend the long running orchestration and raise an event which would be handled by MOM.  This would cause an alert to an administrator who would check out what we think could be a potential error condition.&lt;/p&gt;
&lt;p&gt;When the administrator had checked everything was ok he/she would use the instance id to find the orchestration via the group hub and resume it.&lt;/p&gt;
&lt;p&gt;This is straight forward enough but i also needed to amend the BizUnit tests to handle this condition.&lt;/p&gt;
&lt;p&gt;I amended the tests to check for the event being logged, and I then made BizUnit simulate the corrective action with a custom step.  The final step was to resume the orchestration.&lt;/p&gt;
&lt;p&gt;Because I knew this would be the only functional test running I cheated a little and created a step that would resume all suspended orchestration instances for a given host.  This would save me having to parse the event log message to find the instance id or having to listen for a WMI event being fired.&lt;/p&gt;
&lt;p&gt;When I did the step to resume the orchestration I experienced some strange and unexpected behaviour.  &lt;/p&gt;
&lt;p&gt;The first thing the step did was to use the WMI MSBTS_ServiceInstance class to iterate the service instances for a given host the next step was to use the &lt;font face="Arial"&gt;MSBTS_HostQueue and call the &lt;/font&gt;&lt;font face="Arial"&gt;ResumeServiceInstancesByID which should resume the instance.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;When executed we found the following behaviour:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;The wmi method executed without errors &lt;/li&gt;
    &lt;li&gt;The instance when viewed in the group hub was no longer suspended &lt;/li&gt;
    &lt;li&gt;The instance seemed to stay in a dehydrated state we waited for upto 20 minutes and it didnt become active &lt;/li&gt;
    &lt;li&gt;From the dehydrated state if we suspended then resumed manually through the group hub the instance would complete successfully &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;strong&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The fix was easy enough, basically I changed the resume orchestration call so it used the Microsoft.BizTalk.Operations dll rather than WMI.  This worked fine and the code snippet is below.&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; Microsoft.BizTalk.Operations;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#008080" size="2"&gt;BizTalkOperations&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; ops = &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; &lt;/font&gt;&lt;font face="Courier New" color="#008080" size="2"&gt;BizTalkOperations&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;();&lt;/font&gt; &lt;br /&gt;
&lt;font face="Courier New" color="#008080" size="2"&gt;CompletionStatus&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; status = ops.ResumeInstance(instanceId);&lt;/font&gt; &lt;br /&gt;
&lt;font face="Courier New" color="#008080" size="2"&gt;Trace&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;.WriteLine(&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;"Status = "&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; + status.ToString());&lt;/font&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;u&gt;Disclaimer&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I have noticed a few sites that seem to copy the content of blog articles and display them in their own site.  It is a bit annoying that they do not clearly reference or acknowledge the author so I have decided to put this note on the bottom of all of my posts from now so it is clear who wrote it.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This article was written by: Michael Stephenson&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The source of this article is: http://www.geekswithblogs.net/michaelstephenson&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118544"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118544" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/michaelstephenson/aggbug/118544.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>michael stephenson</dc:creator>
            <guid>http://geekswithblogs.net/michaelstephenson/archive/2008/01/15/118544.aspx</guid>
            <pubDate>Tue, 15 Jan 2008 00:44:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/michaelstephenson/comments/118544.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/michaelstephenson/archive/2008/01/15/118544.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/michaelstephenson/comments/commentRss/118544.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/michaelstephenson/services/trackbacks/118544.aspx</trackback:ping>
        </item>
    </channel>
</rss>