<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>All About Interop : Not Really Interop</title><link>http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx</link><description>Tags: Not Really Interop</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Enable .NET 3.5 goodies in IIS vdir</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/12/05/enable-net-3-5-goodies-in-asp-net-vdir.aspx</link><pubDate>Fri, 05 Dec 2008 20:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9156090</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/9156090.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=9156090</wfw:commentRss><description>&lt;P&gt;Some of you may be oddballs like me:&amp;nbsp; you like .NET, you program in .NET, but you don't always use Visual Studio.&amp;nbsp;&amp;nbsp; You hand-code everything for some applications.&amp;nbsp; You often open up a text editor and just start writing a source module, with no wizards, no project templates, etc.&amp;nbsp; You hand-code your MSbuild files.&amp;nbsp; You hand-code your web.config files. &lt;/P&gt;
&lt;P&gt;Oddballs like us cannot rely on the code-generation that comes with Visual Studio.&amp;nbsp; So when we write a new ASP.NET application, and we want to use the .NET 3.5 goodies in that app - things like var types, and LINQ - we need to explicitly specify that we want .NET 3.5 compilation.&amp;nbsp; Same is true if you are writing a WCF service and want to use REST or any of the var types or LINQ. &lt;/P&gt;
&lt;P&gt;I've done this twice now and had to search for the way to do it both times.&amp;nbsp; I'm putting here as a "note to self" and also as a reference for anyone else.&amp;nbsp; These are the custom magic incantations for web.config, if you want to enable .NET 3.5 in your ASP.NET app, or in your WCF Service - eg, the cool REST stuff from .NET 3.5.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: #a020f0"&gt;?xml&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;version&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"1.0"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;encoding&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"utf-8"&lt;/SPAN&gt;?&amp;gt;
&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;configuration&lt;/SPAN&gt;&amp;gt;

  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;system.web&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;compilation&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;debug&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"false"&lt;/SPAN&gt;&amp;gt;  
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;assemblies&lt;/SPAN&gt;&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;assembly&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;assembly&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;assembly&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;assembly&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"&lt;/SPAN&gt;/&amp;gt;  
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;assemblies&lt;/SPAN&gt;&amp;gt;  
    &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;compilation&lt;/SPAN&gt;&amp;gt;  
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;system.web&lt;/SPAN&gt;&amp;gt;


  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;system.codedom&lt;/SPAN&gt;&amp;gt;  
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;compilers&lt;/SPAN&gt;&amp;gt;  
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;compiler&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;language&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"c#;cs;csharp"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;extension&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;".cs"&lt;/SPAN&gt;   
                &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&lt;/SPAN&gt;   
                &lt;SPAN style="COLOR: #b8860b"&gt;warningLevel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"4"&lt;/SPAN&gt;&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;providerOption&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"CompilerVersion"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;value&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"v3.5"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;providerOption&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"WarnAsError"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;value&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"false"&lt;/SPAN&gt;/&amp;gt;  
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;compiler&lt;/SPAN&gt;&amp;gt;  
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;compiler&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;language&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"vb;vbs;visualbasic;vbscript"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;extension&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;".vb"&lt;/SPAN&gt;   
                &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&lt;/SPAN&gt;   
                &lt;SPAN style="COLOR: #b8860b"&gt;warningLevel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"4"&lt;/SPAN&gt;&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;providerOption&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"CompilerVersion"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;value&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"v3.5"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;providerOption&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"OptionInfer"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;value&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"true"&lt;/SPAN&gt;/&amp;gt;  
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;providerOption&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"WarnAsError"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;value&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"false"&lt;/SPAN&gt;/&amp;gt;  
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;compiler&lt;/SPAN&gt;&amp;gt;  
    &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;compilers&lt;/SPAN&gt;&amp;gt;  
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;system.codedom&lt;/SPAN&gt;&amp;gt; 

&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;configuration&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9156090" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/REST/default.aspx">REST</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/emacs/default.aspx">emacs</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Profiles in Microsoftee-hood</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/16/profiles-in-microsoftee-hood.aspx</link><pubDate>Tue, 16 Sep 2008 17:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8953289</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8953289.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8953289</wfw:commentRss><description>&lt;P&gt;I hadn't seen &lt;A class="" href="http://www.microspotting.com/" mce_href="http://www.microspotting.com"&gt;Microspotting&lt;/A&gt; before - consider me educated. It's a blg site run by a Microsoft employee that profiles... Microsoft employees. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Enough about you.&amp;nbsp; Let's talk about me!&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Yeah, it's self-centered, but despite that I found the blog to be well written and I expect it will be really interesting, for MS employees as well as outsiders.&amp;nbsp; I especially liked the looks inside the different offices, like the&amp;nbsp;&lt;A class="" href="http://www.microspotting.com/2008/09/microsoft-south-lake-union-office" mce_href="http://www.microspotting.com/2008/09/microsoft-south-lake-union-office"&gt;tour of the new west-side South Lake Union office&lt;/A&gt; in Seattle. I even found some profiles of colleagues of mine in there, which is pretty neat.&amp;nbsp; The &lt;A class="" href="http://www.microspotting.com/2008/02/it%e2%80%99s-more-than-open-source%e2%80%94it%e2%80%99s-shared-source#more-164" mce_href="http://www.microspotting.com/2008/02/it%e2%80%99s-more-than-open-source%e2%80%94it%e2%80%99s-shared-source#more-164"&gt;profile on Shawn Burke and the Reference Source project&lt;/A&gt; was nice to see.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;On the about page it says the blog site runs on some non-specified open source content management system.&amp;nbsp; I wonder what it is, and I wonder if there is any interop story there?&lt;/P&gt;
&lt;P&gt;Anyway, Check out Microspotting.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8953289" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Amusing/default.aspx">Amusing</category></item><item><title>What is Scalability?   Do I have Extreme Requirements?</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/07/17/where-does-scalability-come-from.aspx</link><pubDate>Thu, 17 Jul 2008 22:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8744815</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8744815.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8744815</wfw:commentRss><description>&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 0in 0in 0pt; COLOR: #17365d; FONT-FAMILY: Calibri, sans-serif"&gt;&lt;SPAN style="COLOR: windowtext"&gt;Can I turn my Volvo into an F1 Racer?&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 2pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid"&gt;
&lt;P style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; FONT-SIZE: 1pt; PADDING-BOTTOM: 0in; MARGIN: 2pt 0in 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; FONT-FAMILY: Calibri,sans-serif" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="FONT-SIZE: 1pt; MARGIN: 0in 0in 6pt; FONT-FAMILY: Calibri,sans-serif" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;I am a fan of auto racing. I started following racing way, way back. At the low end of the spectrum, anyone with a car can get started racing in autocrosses and track days, for not very much money. At the other end of the spectrum, the pinnacle of the sport, the very top, is &lt;A href="http://www.formula1.com/" mce_href="http://www.formula1.com/"&gt;Formula One&lt;/A&gt;. It's a racing series in which teams field two cars, and they can spend hundreds of millions of dollars for a single season. The cars are very lightweight and produce over 850bhp of power from what engineers would call a "traditional" internal combustion engine, of 2.4 liters displacement. That by the way, is the same displacement engine used in my 1994 Volvo wagon, which delivers about 150bhp, but weighs about 2.5x as much as an F1 racer. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;If I am into acceleration, that comparison should make me very sad. Remembering Newton's Second Law of motion, gold old F=ma, I know that acceleration, in automobiles, is proportional to the power-to-weight ratio of the car. More power means more acceleration. Less weight means more acceleration. The F1 car has a 15x advantage in power-to-weight ratio over my car. Yow. That's horrible. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;If I wanted to add a little more spice to my morning commute, maybe I should think about learning from the F1 McLaren team, and using some of that technology in my Volvo? Would that work? Let's see. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;The F1 engine has a peak internal speed of 19,200 RPM, whereas my Volvo redlines at 7000 RPM. Because the F1 engine has such extreme speeds, the friction generated by it is extreme, and the temperatures, too. The exhaust temperature on an F1 car can reach 1000F. Imagine pulling up to the quickie mart with a glowing-red hot exhaust pipe sticking out. It would be a huge safety issue. Speaking of exhaust, the pipes are custom made, and cost maybe USD$12,000 a pop. The entire engine goes for maybe USD$200,000. The noise generated by an F1 engine can reach 120 db at 20 feet away. That might be a problem for my neighbors. The fuel economy of an F1 car is around 3 mpg. Before you start an F1 engine, you need a team of people to pre-heat it; the tolerances are so close that starting a cold engine would damage it. And on and on. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Hmm, okay. So this all might get kinda impractical. Maybe pinnacle-of-the-industry technology is not right for me. &lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 0in 0in 0pt; COLOR: #17365d; FONT-FAMILY: Calibri, sans-serif"&gt;&lt;SPAN style="COLOR: windowtext"&gt;Where does Scalability Come From?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;On a completely unrelated note, &lt;A class="" href="http://www.25hoursaday.com/weblog/2008/07/14/ScalabilityIDontThinkThatWordMeansWhatYouThinkItDoes.aspx" mce_href="http://www.25hoursaday.com/weblog/2008/07/14/ScalabilityIDontThinkThatWordMeansWhatYouThinkItDoes.aspx"&gt;Dare is continuing to blog on protocols&lt;/A&gt;. This time he takes on the idea that &lt;A href="http://www.webmonkey.com/blog/Google_s_Open_Source_Protocol_Buffers_Offer_Scalability__Speed" mce_href="http://www.webmonkey.com/blog/Google_s_Open_Source_Protocol_Buffers_Offer_Scalability__Speed"&gt;Google's Protocol Buffers bring Scalability and Speed&lt;/A&gt; from Scott Loganbill.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Dare writes: &lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in 0.5in 10pt; COLOR: maroon; FONT-FAMILY: Calibri,sans-serif"&gt;The fact that Google uses &lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d"&gt;&lt;A href="http://labs.google.com/papers/mapreduce.html" mce_href="http://labs.google.com/papers/mapreduce.html"&gt;&lt;B&gt;&lt;SPAN style="COLOR: black"&gt;MapReduce&lt;/SPAN&gt;&lt;/B&gt;&lt;/A&gt;&lt;/SPAN&gt; and &lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d"&gt;&lt;A href="http://labs.google.com/papers/bigtable.html"&gt;&lt;B&gt;&lt;SPAN style="COLOR: black"&gt;BigTable&lt;/SPAN&gt;&lt;/B&gt;&lt;/A&gt;&lt;/SPAN&gt; to solve problems in a particular problem space does not mean those technologies work well in others. MapReduce isn't terribly useful if you are building an instant messaging service. Similarly, if you are building an email service you want an infrastructure based on message queuing not BigTable. A binary wire format like Protocol Buffers is a smart idea if your applications bottleneck is network bandwidth or CPU used when serializing/deserializing XML.&amp;nbsp; As part of building their search engine Google has to cache a significant chunk of the World Wide Web and then perform data intensive operations on that data. In Google's scenarios, the network bandwidth utilized when transferring the massive amounts of data they process can actually be the bottleneck. Hence inventing a technology like Protocol Buffers became a necessity. However, that isn't Twitter's problem so a technology like Protocol Buffers isn't going to "help them scale". Twitter's problems have been &lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d"&gt;&lt;A title="It's Not Rocket Science, But It's Our Work" href="http://blog.twitter.com/2008/05/its-not-rocket-science-but-its-our-work.html"&gt;&lt;B&gt;&lt;SPAN style="COLOR: black"&gt;clearly spelled out by the development team&lt;/SPAN&gt;&lt;/B&gt;&lt;/A&gt; &lt;/SPAN&gt;and nowhere is network bandwidth called out as a culprit. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;I completely agree. We can all get a little sloppy. "If it works for THEM, it's probably the perfect thing for ME." Nope. That is a dangerous habit to get into. Are we F1 racers, or commuters, or something in between? Can we tolerate the costs, the 1000F exhaust temperatures and the extreme noise of an F1-class infrastructure? Probably not We need to be more thoughtful about our requirements. Technology does not always transfer downward effectively from the pinnacle of any industry.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Dare also asserts, &lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in 0.5in 10pt; COLOR: maroon; FONT-FAMILY: Calibri,sans-serif"&gt;If someone tells you "technology X doesn't scale" without qualifying that statement, it often means the person either doesn't know what he is talking about or is trying to sell you something. Technologies don't scale, services do. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;I think what he means by "services" in this context is "implementations".&amp;nbsp;&amp;nbsp; Even so, I cannot completely agree here.&amp;nbsp; &lt;STRONG&gt;&lt;EM&gt;Some technologies just don't scale well.&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;On the other hand, to say that "XML doesn't scale", as Mr Loganbill seems to do,&amp;nbsp;asks us all to ignore the success XML has enjoyed since the late 90's. It scales, up as well as down.&amp;nbsp; From my mobile phone to the datacenter.&amp;nbsp; Does XML solve all problems? No. Google had some particular data-shipping scenarios for which XML was not an optimal solution. We can conclude "XML did not meet the requirements of Google in some particular cases."&amp;nbsp; That does not mean "XML does not scale." To draw that general conclusion is to deny the reality of the internet today. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;There's an exponential decay curve that describes the scalability requirements for all apps in the world, where the Y-axis can be any aspect of scalability:&amp;nbsp; number of users, petabytes of data handled, number of transactions, and so on.&amp;nbsp; &lt;/P&gt;
&lt;P align=center&gt;&lt;IMG height=258 src="http://blogs.msdn.com/blogfiles/dotnetinterop/071708_2104_xxx1.png" width=355&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Your app, dear reader, is probably not in the first 25% of that curve. Google's is. But yours probably isn't. Google's network is at the pinnacle of the industry. The most extreme requirements. Are you at that point? Probably not.&amp;nbsp; And even if you are, you ought to examine your own requirements closely, rather than just "doing with the other guy did."&amp;nbsp; This all goes to show that just because Google believes that Protocol Buffers (or whatever - you pick the particular technology choice) is the most effective solution for their particular problem space, does not mean that the given technology choice is the right one for YOU too. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Getting back to F1: it's true that some technologies have migrated from F1 to passenger cars. For example, now it is possible to get cars with carbon-ceramic disc brakes, just like an F1 car. Some cars have flippy-paddle shifters, just like an F1 car. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;But... not everything translates so readily. And even with those technologies, there is a cost/benefit analysis that is worth doing.&amp;nbsp; Do I &lt;EM&gt;need &lt;/EM&gt;ceramic brakes or can I just buy commodity cast-iron discs for much less cost?&amp;nbsp; (If you know me, you know the choice I made here).&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif"&gt;Technology that is just perfect for an F1 racer, is probably not exactly right for the commuter. &lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in 0in 10pt; FONT-FAMILY: Calibri,sans-serif" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8744815" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category></item><item><title>.NET Terrarium - it's BAAAAAACK! </title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/07/16/net-terrarium-it-s-baaaaaack.aspx</link><pubDate>Thu, 17 Jul 2008 01:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8740792</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8740792.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8740792</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Remember Terrarium?&amp;nbsp; It&amp;nbsp;was a .NET 1.0 learning tool disguised as a game.&amp;nbsp; Microsoft released a developer's kit, and and people built herbivores, carnivores, or plants and introduced them into a peer-to-peer, networked ecosystem where they interacted and sometimes competed for survival. There was a visual display element of course.&amp;nbsp; It was kinda like SimCity crossed with a .NET Tutorial, all run on a peer-to-peer network.&amp;nbsp; People had a ton of fun with it; there were competitions and Terrarium events, it really captured the attention of the community.&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Well,......... it's back! &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;A fella by the name of Bill Simser has resurrected Terrarium, put it on CodePlex, and is inviting participation!&amp;nbsp;&amp;nbsp; Terrarium 2.0 demonstrates some of the features of the .NET Framework, including Windows Forms integration with DirectX®; XML Web services; support for peer-to-peer networking; support for multiple programming languages; the capability to update smart client (Windows-based) applications via a remote Web server; and the evidence-based and code access security infrastructure. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="COLOR: black"&gt;&lt;FONT face=Calibri size=3&gt;Read &lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;about it here &lt;/FONT&gt;&lt;A href="http://weblogs.asp.net/bsimser/archive/2008/07/16/reintroducing-terrarium-now-with-2-0-goodness.aspx" target=_blank mce_href="http://weblogs.asp.net/bsimser/archive/2008/07/16/reintroducing-terrarium-now-with-2-0-goodness.aspx"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;http://weblogs.asp.net/bsimser/archive/2008/07/16/reintroducing-terrarium-now-with-2-0-goodness.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="COLOR: black"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;If you want to try your hand at producing a critter, Bill's got a Terrarium server up and running already. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;This could be a fun, engaging, and collaborative way to introduce .NET programming skills into your company or organization. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;FONT face=Calibri size=3&gt;On the other hand, i&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;f you ever wanted to participate in the construction of a peer-to-peer mesh, contributing to the Terrarium project on Codeplex could be your chance! &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;FONT face=Calibri size=3&gt;&lt;SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;FONT face=Calibri size=3&gt;&lt;SPAN lang=EN style="COLOR: maroon; mso-ansi-language: EN"&gt;[Edit: Just one thing - Terrarium in its current form depends on DirectX 7 (yes, it's THAT old) which Vista does not have.&amp;nbsp; So if you are wanting to install this on Vista, you will need to &lt;A class="" href="http://weblogs.asp.net/bsimser/archive/2008/07/16/terrarium-for-vista-whoops.aspx" mce_href="http://weblogs.asp.net/bsimser/archive/2008/07/16/terrarium-for-vista-whoops.aspx"&gt;take special action&lt;/A&gt;. ]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8740792" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category></item><item><title>Interesting - CacheMan for .NET</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/04/25/interesting-cacheman-for-net.aspx</link><pubDate>Fri, 25 Apr 2008 22:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8424670</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8424670.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8424670</wfw:commentRss><description>&lt;P&gt;A distributed object cache (distributed hashtable)&amp;nbsp;for .NET&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sriramkrishnan.com/blog/2008/02/cacheman-fast-distributed-hashtable-for.html"&gt;http://www.sriramkrishnan.com/blog/2008/02/cacheman-fast-distributed-hashtable-for.html&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8424670" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category></item><item><title>Powershell script to batch-update AssemblyInfo.cs with new Version</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/04/21/powershell-script-to-batch-update-assemblyinfo-cs-with-new-version.aspx</link><pubDate>Mon, 21 Apr 2008 18:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8410410</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8410410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8410410</wfw:commentRss><description>&lt;P&gt;I wrote this script to update all the AssemblyInfo.cs files in a Visual Studio solution, to have the same version number. This is the kind of thing I would have used Perl to do, in the past. But Powershell's got this covered nicely. &lt;/P&gt;
&lt;P style="COLOR: maroon"&gt;&lt;EM&gt;[ 23 April 2008 - 1150am PST - I updated the script to deal with the AssemblyInfo.vb files in a VB project, and also to deal with version numbers that have less than 4 digits. Thanks for the suggestion, Jason! ] &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Maybe someone can learn from this. &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #b22222"&gt;# &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;SetVersion.ps1
#
# Set the version in all the AssemblyInfo.cs or AssemblyInfo.vb files in any subdirectory.
#
# usage:  
#  from cmd.exe: 
#     powershell.exe SetVersion.ps1  2.8.3.0
# 
#  from powershell.exe prompt: 
#     .\SetVersion.ps1  2.8.3.0
#
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;# &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;last saved Time-stamp: &amp;lt;Wednesday, April 23, 2008  11:46:40  (by dinoch)&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;#&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;
&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #a020f0"&gt;function&lt;/SPAN&gt; Usage
{
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"Usage: "&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"  from cmd.exe: "&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"     powershell.exe SetVersion.ps1  2.8.3.0"&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;" "&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"  from powershell.exe prompt: "&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"     .\SetVersion.ps1  2.8.3.0"&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;" "&lt;/SPAN&gt;;
}


&lt;SPAN style="COLOR: #a020f0"&gt;function&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;Update-SourceVersion&lt;/SPAN&gt;
{
  Param ([string]&lt;SPAN style="COLOR: #b8860b"&gt;$Version&lt;/SPAN&gt;)
  &lt;SPAN style="COLOR: #b8860b"&gt;$NewVersion&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #bc8f8f"&gt;'AssemblyVersion("'&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #b8860b"&gt;$Version&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #bc8f8f"&gt;'")'&lt;/SPAN&gt;;
  &lt;SPAN style="COLOR: #b8860b"&gt;$NewFileVersion&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #bc8f8f"&gt;'AssemblyFileVersion("'&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #b8860b"&gt;$Version&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #bc8f8f"&gt;'")'&lt;/SPAN&gt;;

  &lt;SPAN style="COLOR: #a020f0"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #b8860b"&gt;$o&lt;/SPAN&gt; in &lt;SPAN style="COLOR: #b8860b"&gt;$input&lt;/SPAN&gt;) 
  {
    &lt;SPAN style="COLOR: #0000ff"&gt;Write-output&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$o.FullName&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b8860b"&gt;$TmpFile&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #b8860b"&gt;$o.FullName&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #bc8f8f"&gt;".tmp"&lt;/SPAN&gt;

     &lt;SPAN style="COLOR: #0000ff"&gt;get-content&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$o.FullName&lt;/SPAN&gt; | 
        %{&lt;SPAN style="COLOR: #b8860b"&gt;$_&lt;/SPAN&gt; &lt;SPAN style="COLOR: #228b22"&gt;-replace&lt;/SPAN&gt; &lt;SPAN style="COLOR: #bc8f8f"&gt;'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #b8860b"&gt;$NewVersion&lt;/SPAN&gt; } |
        %{&lt;SPAN style="COLOR: #b8860b"&gt;$_&lt;/SPAN&gt; &lt;SPAN style="COLOR: #228b22"&gt;-replace&lt;/SPAN&gt; &lt;SPAN style="COLOR: #bc8f8f"&gt;'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #b8860b"&gt;$NewFileVersion&lt;/SPAN&gt; }  &amp;gt; &lt;SPAN style="COLOR: #b8860b"&gt;$TmpFile&lt;/SPAN&gt;

     &lt;SPAN style="COLOR: #0000ff"&gt;move-item&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$TmpFile&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$o.FullName&lt;/SPAN&gt; &lt;SPAN style="COLOR: #228b22"&gt;-force&lt;/SPAN&gt;
  }
}


&lt;SPAN style="COLOR: #a020f0"&gt;function&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;Update-AllAssemblyInfoFiles&lt;/SPAN&gt; ( &lt;SPAN style="COLOR: #b8860b"&gt;$version&lt;/SPAN&gt; )
{
  &lt;SPAN style="COLOR: #a020f0"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #b8860b"&gt;$file&lt;/SPAN&gt; in &lt;SPAN style="COLOR: #bc8f8f"&gt;"AssemblyInfo.cs"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #bc8f8f"&gt;"AssemblyInfo.vb"&lt;/SPAN&gt; ) 
  {
    &lt;SPAN style="COLOR: #0000ff"&gt;get-childitem&lt;/SPAN&gt; &lt;SPAN style="COLOR: #228b22"&gt;-recurse&lt;/SPAN&gt; |? {&lt;SPAN style="COLOR: #b8860b"&gt;$_.Name&lt;/SPAN&gt; &lt;SPAN style="COLOR: #228b22"&gt;-eq&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$file&lt;/SPAN&gt;} | &lt;SPAN style="COLOR: #0000ff"&gt;Update-SourceVersion&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$version&lt;/SPAN&gt; ;
  }
}


&lt;SPAN style="COLOR: #b22222"&gt;# &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;validate arguments 
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b8860b"&gt;$r&lt;/SPAN&gt;= [System.Text.RegularExpressions.Regex]::Match(&lt;SPAN style="COLOR: #b8860b"&gt;$args&lt;/SPAN&gt;[0], &lt;SPAN style="COLOR: #bc8f8f"&gt;"^[0-9]+(\.[0-9]+){1,3}$"&lt;/SPAN&gt;);

&lt;SPAN style="COLOR: #a020f0"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #b8860b"&gt;$r.Success&lt;/SPAN&gt;)
{
  &lt;SPAN style="COLOR: #0000ff"&gt;Update-AllAssemblyInfoFiles&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;$args&lt;/SPAN&gt;[0];
}
&lt;SPAN style="COLOR: #a020f0"&gt;else&lt;/SPAN&gt;
{
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;" "&lt;/SPAN&gt;;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;"Bad Input!"&lt;/SPAN&gt;
  echo &lt;SPAN style="COLOR: #bc8f8f"&gt;" "&lt;/SPAN&gt;;
  Usage ;
}
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8410410" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/8410410.ashx" length="1627" type="application/octet-stream" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>MSBuild script for compiling each .cs file into an EXE</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/04/16/msbuild-script-for-compiling-each-cs-file-into-an-exe.aspx</link><pubDate>Wed, 16 Apr 2008 20:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8396703</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8396703.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8396703</wfw:commentRss><description>&lt;P&gt;I previously wrote about &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2008/04/08/msbuild-script-for-compiling-all-cs-files-into-a-single-assembly-dll-or-exe.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2008/04/08/msbuild-script-for-compiling-all-cs-files-into-a-single-assembly-dll-or-exe.aspx"&gt;using MSBuild to build all .cs files in a directory into a single exe&lt;/A&gt;. Here's a companion script that builds every .cs file into a separate exe. &lt;/P&gt;
&lt;P&gt;This might be helpful for directories where you keep sets of small projects, where each source file stands alone, that sort of thing. &lt;/P&gt;
&lt;P&gt;(I'm posting these things just as simple illustrations to help people along with their own MSBuild things) &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Project&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt;
         &lt;SPAN style="COLOR: #b8860b"&gt;DefaultTargets&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"CompileEach"&lt;/SPAN&gt;
         &lt;SPAN style="COLOR: #b8860b"&gt;ToolsVersion&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"3.5"&lt;/SPAN&gt;
         &amp;gt;

  &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;This build file compiles each .cs file into its own exe &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Import&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Project&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"$(MSBuildToolsPath)\Microsoft.CSharp.targets"&lt;/SPAN&gt; /&amp;gt;
  &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Import Project="c:\.net3.5\Microsoft.Csharp.targets" /    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;PropertyGroup&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Condition&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"'$(Configuration)'==''"&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Configuration&lt;/SPAN&gt;&amp;gt;Debug&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;Configuration&lt;/SPAN&gt;&amp;gt;   &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Default &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;PropertyGroup&lt;/SPAN&gt;&amp;gt;

  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;PropertyGroup&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Condition&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"'$(Configuration)'=='Debug'"&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Optimize&lt;/SPAN&gt;&amp;gt;false&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;Optimize&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;DebugSymbols&lt;/SPAN&gt;&amp;gt;true&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;DebugSymbols&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;.\bin&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;PropertyGroup&lt;/SPAN&gt;&amp;gt;

  &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Specify the inputs by type and file name &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemGroup&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;CSFile&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"*.cs"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;ItemGroup&lt;/SPAN&gt;&amp;gt;

  &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;specify reference assemblies for all builds in this project &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemGroup&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"mscorlib"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"WindowsBase"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"PresentationCore"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"PresentationFramework"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"System.Printing"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Include&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ReachFramework"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;ItemGroup&lt;/SPAN&gt;&amp;gt;

  &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Target&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"CompileEach"&lt;/SPAN&gt;
          &lt;SPAN style="COLOR: #b8860b"&gt;DependsOnTargets&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ResolveAssemblyReferences"&lt;/SPAN&gt;
          &amp;gt;

    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;ResolveAssemblyReferences resolves the short names of the assemblies &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;named in the @(Reference) vector, into fully-qualified DLL names.    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;The task is defined in the Microsoft.Csharp.targets file.            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;The output of it is the @(ReferencePath) vector.                     &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Message&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Text&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Reference = @(Reference)"&lt;/SPAN&gt; /&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;Message&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Text&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ReferencePath = @(ReferencePath)"&lt;/SPAN&gt; /&amp;gt;

    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Message Text="MS Build Tools path:  $(MSBuildToolsPath)" / &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Run the Visual C# compilation on EACH .cs file. &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;see http://msdn2.microsoft.com/en-us/library/s5c8athz.aspx  for more info    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;By using the %(CSFile.identity) scalar, we run this task once for each       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;file.  The converse would be @(CSFile.identity).  That would run the compile &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;once, for all files, compiling them all together into a single assembly.     &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Not what we want here.                                                       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;CSC&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #b8860b"&gt;Sources&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"%(CSFile.Identity)"&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #b8860b"&gt;References&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"@(ReferencePath)"&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #b8860b"&gt;OutputAssembly&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"$(OutputPath)\%(CSFile.filename).exe"&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #b8860b"&gt;EmitDebugInformation&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"$(DebugSymbols)"&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #b8860b"&gt;Toolpath&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"$(MSBuildToolsPath)"&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #b8860b"&gt;Nologo&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"true"&lt;/SPAN&gt;
       &amp;gt;
    &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;CSC&lt;/SPAN&gt;&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;Target&lt;/SPAN&gt;&amp;gt;

&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;Project&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;To use it, run this:&lt;BR&gt;&lt;FONT family="Courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c:\windows\Microsoft.NET\Framework\v3.5\msbuild.exe build.xml &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8396703" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/MSBuild/default.aspx">MSBuild</category></item><item><title>WPF invokes Powershell.exe as an inferior shell</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/04/11/wpf-invokes-powershell-exe-as-an-inferior-shell.aspx</link><pubDate>Fri, 11 Apr 2008 18:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8376424</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8376424.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8376424</wfw:commentRss><description>&lt;P&gt;I wrote this up as an example of how to run powershell.exe as an inferior shell from within a WPF app. &lt;/P&gt;
&lt;P&gt;It is not a "Powershell host" in the normal sense of the word, with a &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.management.automation.runspaces.runspace(VS.85).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.management.automation.runspaces.runspace(VS.85).aspx"&gt;RunSpace&lt;/A&gt; and a &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.management.automation.runspaces.runspacefactory.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.management.automation.runspaces.runspacefactory.aspx"&gt;RunSpaceFactory&lt;/A&gt; and so on.&amp;nbsp; Instead, this example uses &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx"&gt;System.Diagnostics.Process&lt;/A&gt; to start powershell.exe as a process, and redirect stdin, stdout, and stderr.&amp;nbsp; The result of those things is displayed in a WPF &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.textblock.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.textblock.aspx"&gt;TextBlock&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;The key bit is the Shell class, which I show here.&amp;nbsp; It includes async i/o for the output.&amp;nbsp; &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Collections.Generic;\par ??\cf1 using\cf0  System.Linq;\par ??\cf1 using\cf0  System.Text;\par ??\par ??\cf1 namespace\cf0  WPF_Host_for_PowerShell\par ??\{\par ??    \cf1 class\cf0  \cf4 Shell\par ??\cf0     \{\par ??        \cf1 public\cf0  \cf1 delegate\cf0  \cf1 void\cf0  \cf4 OutputReceived\cf0 (\cf4 String\cf0  output);\par ??\par ??        \cf1 private\cf0  System.Diagnostics.\cf4 Process\cf0  _p;\par ??        \cf1 private\cf0  System.\cf4 AsyncCallback\cf0  _rc = \cf1 null\cf0 ;\par ??        \cf1 private\cf0  System.IO.\cf4 StreamWriter\cf0  _sw;\par ??\par ??        \cf1 public\cf0  System.IO.\cf4 StreamWriter\cf0  Input \{ \cf1 get\cf0  \{ \cf1 return\cf0  _sw; \} \}\par ??        \cf1 public\cf0  \cf4 OutputReceived\cf0  StdoutOutputReceived \{ \cf1 get\cf0 ; \cf1 set\cf0 ; \}\par ??        \cf1 public\cf0  \cf4 OutputReceived\cf0  StderrOutputReceived \{ \cf1 get\cf0 ; \cf1 set\cf0 ; \}\par ??\par ??        \cf1 public\cf0  Shell(\cf4 String\cf0  exe, \cf1 string\cf0  args, \cf4 OutputReceived\cf0  callback1, \cf4 OutputReceived\cf0  callback2)\par ??        \{\par ??            _rc = \cf1 new\cf0  System.\cf4 AsyncCallback\cf0 (ReadCompleted);\par ??            StdoutOutputReceived = callback1;\par ??            StderrOutputReceived = callback2;\par ??            Launch(exe, args);\par ??        \}\par ??\par ??\par ??        \cf1 public\cf0  \cf1 class\cf0  \cf4 StreamState\par ??\cf0         \{\par ??            \cf1 public\cf0  System.IO.\cf4 Stream\cf0  Stream;\par ??            \cf1 public\cf0  \cf1 byte\cf0 [] Buffer;\par ??            \cf1 public\cf0  \cf4 OutputReceived\cf0  Callback;\par ??\par ??            \cf1 public\cf0  \cf1 const\cf0  \cf1 int\cf0  DefaultBufferSize = 2048;\par ??\par ??            \cf1 public\cf0  StreamState(System.IO.\cf4 Stream\cf0  stream, \cf4 OutputReceived\cf0  callback)\par ??            \{\par ??                Buffer = \cf1 new\cf0  \cf1 byte\cf0 [DefaultBufferSize];\par ??                Stream = stream;\par ??                Callback = callback;\par ??            \}\par ??        \}\par ??\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  ReadCompleted(System.\cf4 IAsyncResult\cf0  asyncResult)\par ??        \{\par ??            \cf4 StreamState\cf0  state = (\cf4 StreamState\cf0 )asyncResult.AsyncState;\par ??            \cf1 int\cf0  BytesRead = state.Stream.EndRead(asyncResult);\par ??            \cf1 if\cf0  (BytesRead &amp;gt; 0)\par ??            \{\par ??                \cf1 if\cf0  (state.Callback != \cf1 null\cf0 )\par ??                    state.Callback(System.Text.\cf4 Encoding\cf0 .ASCII.GetString(state.Buffer, 0, BytesRead));\par ??\par ??                System.Threading.\cf4 Thread\cf0 .Sleep(20);\par ??                \cf5 // repeat: \par ??\cf0                 state.Stream.BeginRead(state.Buffer,\par ??                    0,\par ??                    state.Buffer.Length,\par ??                    _rc,\par ??                    state);\par ??            \}\par ??\par ??        \}\par ??\par ??\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  KickoffAsyncReading(System.IO.\cf4 Stream\cf0  stream, \cf4 OutputReceived\cf0  callback)\par ??        \{\par ??            \cf5 // initialize the state for this async read loop: \par ??\cf0             \cf4 StreamState\cf0  state = \cf1 new\cf0  \cf4 StreamState\cf0 (stream, callback);\par ??            System.Threading.\cf4 Thread\cf0 .Sleep(20);\par ??            stream.BeginRead(state.Buffer,  \cf5 // where to put the results\par ??\cf0                 0,                          \cf5 // offset\par ??\cf0                 state.Buffer.Length,        \cf5 // how many bytes (BUFFER_SIZE)\par ??\cf0                 _rc,                        \cf5 // ReadCompleted call back delegate\par ??\cf0                 state);                     \cf5 // local state object\par ??\cf0         \}\par ??\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  Launch(\cf1 string\cf0  shellexe, \cf1 string\cf0  args)\par ??        \{\par ??            _p = \cf1 new\cf0  System.Diagnostics.\cf4 Process\cf0 ();\par ??            _p.StartInfo.FileName = shellexe;\par ??            _p.StartInfo.Arguments = args;\par ??            _p.StartInfo.WindowStyle = System.Diagnostics.\cf4 ProcessWindowStyle\cf0 .Hidden;\par ??            _p.StartInfo.CreateNoWindow = \cf1 true\cf0 ;\par ??\par ??            _p.StartInfo.RedirectStandardOutput = \cf1 true\cf0 ;\par ??            _p.StartInfo.RedirectStandardError = \cf1 true\cf0 ;\par ??            _p.StartInfo.RedirectStandardInput = \cf1 true\cf0 ;\par ??            _p.StartInfo.UseShellExecute = \cf1 false\cf0 ;  \cf5 // required for redirect\par ??\par ??\cf0             _p.Start();\par ??\par ??            _sw = _p.StandardInput;\par ??            KickoffAsyncReading(_p.StandardOutput.BaseStream, StdoutOutputReceived);\par ??            KickoffAsyncReading(_p.StandardError.BaseStream, StderrOutputReceived);\par ??        \}\par ??\par ??\par ??        \cf1 public\cf0  \cf1 void\cf0  Stop()\par ??        \{\par ??            \cf1 try\par ??\cf0             \{\par ??                _p.Kill();\par ??            \}\par ??            \cf1 catch\cf0  \{ \}\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Collections.Generic;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Linq;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Text;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; WPF_Host_for_PowerShell&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Shell&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;delegate&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;String&lt;/SPAN&gt; output);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; System.Diagnostics.&lt;SPAN style="COLOR: #2b91af"&gt;Process&lt;/SPAN&gt; _p;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; System.&lt;SPAN style="COLOR: #2b91af"&gt;AsyncCallback&lt;/SPAN&gt; _rc = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;StreamWriter&lt;/SPAN&gt; _sw;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;StreamWriter&lt;/SPAN&gt; Input { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _sw; } }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; StdoutOutputReceived { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; StderrOutputReceived { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Shell(&lt;SPAN style="COLOR: #2b91af"&gt;String&lt;/SPAN&gt; exe, &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; args, &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; callback1, &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; callback2)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _rc = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.&lt;SPAN style="COLOR: #2b91af"&gt;AsyncCallback&lt;/SPAN&gt;(ReadCompleted);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; StdoutOutputReceived = callback1;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; StderrOutputReceived = callback2;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Launch(exe, args);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StreamState&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; Stream;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;byte&lt;/SPAN&gt;[] Buffer;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; Callback;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; DefaultBufferSize = 2048;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; StreamState(System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; stream, &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; callback)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&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;&amp;nbsp; Buffer = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;byte&lt;/SPAN&gt;[DefaultBufferSize];&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&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;&amp;nbsp; Stream = stream;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&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;&amp;nbsp; Callback = callback;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ReadCompleted(System.&lt;SPAN style="COLOR: #2b91af"&gt;IAsyncResult&lt;/SPAN&gt; asyncResult)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;StreamState&lt;/SPAN&gt; state = (&lt;SPAN style="COLOR: #2b91af"&gt;StreamState&lt;/SPAN&gt;)asyncResult.AsyncState;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; BytesRead = state.Stream.EndRead(asyncResult);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (BytesRead &amp;gt; 0)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (state.Callback != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; state.Callback(System.Text.&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;.ASCII.GetString(state.Buffer, 0, BytesRead));&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/SPAN&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;&amp;nbsp; System.Threading.&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;.Sleep(20);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// repeat: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/SPAN&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;&amp;nbsp; state.Stream.BeginRead(state.Buffer,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 0,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; state.Buffer.Length,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _rc,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; state);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; KickoffAsyncReading(System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt; stream, &lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt; callback)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// initialize the state for this async read loop: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;StreamState&lt;/SPAN&gt; state = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StreamState&lt;/SPAN&gt;(stream, callback);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;.Sleep(20);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; stream.BeginRead(state.Buffer,&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// where to put the results&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/SPAN&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;&amp;nbsp; 0,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&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;SPAN style="COLOR: green"&gt;// offset&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/SPAN&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;&amp;nbsp; state.Buffer.Length,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// how many bytes (BUFFER_SIZE)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/SPAN&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;&amp;nbsp; _rc,&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &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;SPAN style="COLOR: green"&gt;// ReadCompleted call back delegate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;77&lt;/SPAN&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;&amp;nbsp; state);&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;SPAN style="COLOR: green"&gt;// local state object&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;78&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;79&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;80&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;81&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Launch(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; shellexe, &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;82&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;83&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Diagnostics.&lt;SPAN style="COLOR: #2b91af"&gt;Process&lt;/SPAN&gt;();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;84&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.FileName = shellexe;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;85&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.Arguments = args;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;86&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.WindowStyle = System.Diagnostics.&lt;SPAN style="COLOR: #2b91af"&gt;ProcessWindowStyle&lt;/SPAN&gt;.Hidden;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;87&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.CreateNoWindow = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;88&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;89&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.RedirectStandardOutput = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;90&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.RedirectStandardError = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;91&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.RedirectStandardInput = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;92&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.StartInfo.UseShellExecute = &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// required for redirect&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;93&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;94&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _p.Start();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;95&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;96&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _sw = _p.StandardInput;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;97&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; KickoffAsyncReading(_p.StandardOutput.BaseStream, StdoutOutputReceived);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;98&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; KickoffAsyncReading(_p.StandardError.BaseStream, StderrOutputReceived);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;99&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;100&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;101&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;102&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Stop()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;103&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;104&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;105&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;106&lt;/SPAN&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;&amp;nbsp; _p.Kill();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;107&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;108&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt; { }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;109&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;110&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;111&lt;/SPAN&gt;&amp;nbsp;}&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;To use it, it looks something like this: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red128\green128\blue128;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Collections.Generic;\par ??\cf1 using\cf0  System.Linq;\par ??\cf1 using\cf0  System.Text;\par ??\cf1 using\cf0  System.Windows;\par ??\cf1 using\cf0  System.Windows.Controls;\par ??\cf1 using\cf0  System.Windows.Data;\par ??\cf1 using\cf0  System.Windows.Documents;\par ??\cf1 using\cf0  System.Windows.Input;\par ??\cf1 using\cf0  System.Windows.Media;\par ??\cf1 using\cf0  System.Windows.Media.Imaging;\par ??\cf1 using\cf0  System.Windows.Navigation;\par ??\cf1 using\cf0  System.Windows.Shapes;\par ??\par ??\cf1 namespace\cf0  WPF_Host_for_PowerShell\par ??\{\par ??    \cf4 ///\cf5  \cf4 &amp;lt;summary&amp;gt;\par ??\cf0     \cf4 ///\cf5  Interaction logic for Window1.xaml\par ??\cf0     \cf4 ///\cf5  \cf4 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf1 public\cf0  \cf1 partial\cf0  \cf1 class\cf0  \cf6 Window1\cf0  : \cf6 Window\par ??\cf0     \{\par ??        \cf1 delegate\cf0  \cf1 void\cf0  \cf6 MyAppendCallback\cf0 (\cf1 string\cf0  s, System.Windows.Media.\cf6 Brush\cf0  color);\par ??\par ??        \cf6 Shell\cf0  shell;\par ??        \cf6 TextBlock\cf0  currentTextBlock= \cf1 null\cf0 ;\par ??        \cf6 MyAppendCallback\cf0  AppendDelegate = \cf1 null\cf0 ;\par ??\par ??        \cf1 public\cf0  Window1()\par ??        \{\par ??            InitializeComponent();\par ??\par ??            AppendDelegate= \cf1 new\cf0  \cf6 MyAppendCallback\cf0 (MyAppend);\par ??        \}\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  MyAppend(\cf1 string\cf0  s, System.Windows.Media.\cf6 Brush\cf0  color)\par ??        \{\par ??            \cf1 if\cf0  (\cf1 this\cf0 .Scroller1.Dispatcher.Thread != System.Threading.\cf6 Thread\cf0 .CurrentThread)\par ??            \{\par ??                \cf1 this\cf0 .Dispatcher.BeginInvoke\par ??                    (System.Windows.Threading.\cf6 DispatcherPriority\cf0 .Normal, AppendDelegate, s, \cf1 new\cf0  \cf1 object\cf0 [] \{ color \});\par ??                \cf1 return\cf0 ;\par ??            \}\par ??\par ??            \cf1 lock\cf0  (\cf1 this\cf0 .Scroller1)\par ??            \{\par ??                \cf1 if\cf0  (s != \cf7 ""\cf0 )\par ??                    \cf1 this\cf0 .currentTextBlock.Inlines.Add(\cf1 new\cf0  \cf6 Run\cf0 () \{ Text = s, Foreground = color \});\par ??\par ??                \cf1 this\cf0 .Scroller1.ScrollToBottom();\par ??            \}\par ??        \}\par ??\par ??        \cf1 void\cf0  StdoutReceived(\cf1 string\cf0  t)\par ??        \{\par ??            MyAppend(t, System.Windows.Media.\cf6 Brushes\cf0 .BlueViolet);\par ??        \}\par ??\par ??        \cf1 void\cf0  StderrReceived(\cf1 string\cf0  t)\par ??        \{\par ??            MyAppend(t, System.Windows.Media.\cf6 Brushes\cf0 .Red);\par ??        \}\par ??\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  Window_Loaded(\cf1 object\cf0  sender, \cf6 RoutedEventArgs\cf0  e)\par ??        \{\par ??            \cf5 // creating the shell starts it up\par ??\cf0             shell = \cf1 new\cf0  \cf6 Powershell\cf0 (\par ??                \cf1 new\cf0  \cf6 Shell\cf0 .\cf6 OutputReceived\cf0 (StdoutReceived),\par ??                \cf1 new\cf0  \cf6 Shell\cf0 .\cf6 OutputReceived\cf0 (StderrReceived));\par ??\par ??            InitCommand();\par ??\par ??            shell.Input.WriteLine(\cf7 "prompt"\cf0 );\par ??            shell.Input.Flush();\par ??        \}\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  InitCommand()\par ??        \{\par ??            \cf5 // add a new textblock for each command\par ??\cf0             currentTextBlock = \cf1 new\cf0  \cf6 TextBlock\cf0 ();\par ??            currentTextBlock.FontFamily = \cf1 new\cf0  \cf6 FontFamily\cf0 (\cf7 "Consolas"\cf0 );\par ??            currentTextBlock.Margin = \cf1 new\cf0  \cf6 Thickness\cf0 (0d);\par ??            \cf5 //currentTextBlock.Foreground = color;\par ??\cf0             \cf1 this\cf0 .OutputPanel.Children.Add(currentTextBlock);\par ??        \}\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  Button_Click(\cf1 object\cf0  sender, \cf6 RoutedEventArgs\cf0  e)\par ??        \{\par ??            InitCommand();\par ??\par ??            MyAppend(\cf1 this\cf0 .textBox1.Text, System.Windows.Media.\cf6 Brushes\cf0 .SteelBlue);\par ??            shell.Input.WriteLine(\cf1 this\cf0 .textBox1.Text);\par ??\par ??            shell.Input.WriteLine(\cf7 "prompt"\cf0 );\par ??            shell.Input.Flush();\par ??        \}\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  Window_Closing(\cf1 object\cf0  sender, System.ComponentModel.\cf6 CancelEventArgs\cf0  e)\par ??        \{\par ??            shell.Stop();\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Collections.Generic;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Linq;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Text;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Controls;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Data;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Documents;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Input;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Media;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Media.Imaging;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Navigation;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Windows.Shapes;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; WPF_Host_for_PowerShell&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;summary&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Interaction logic for Window1.xaml&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/summary&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Window1&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;Window&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;delegate&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyAppendCallback&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; s, System.Windows.Media.&lt;SPAN style="COLOR: #2b91af"&gt;Brush&lt;/SPAN&gt; color);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;Shell&lt;/SPAN&gt; shell;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;TextBlock&lt;/SPAN&gt; currentTextBlock= &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;MyAppendCallback&lt;/SPAN&gt; AppendDelegate = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Window1()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AppendDelegate= &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyAppendCallback&lt;/SPAN&gt;(MyAppend);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; MyAppend(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; s, System.Windows.Media.&lt;SPAN style="COLOR: #2b91af"&gt;Brush&lt;/SPAN&gt; color)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Scroller1.Dispatcher.Thread != System.Threading.&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;.CurrentThread)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Dispatcher.BeginInvoke&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (System.Windows.Threading.&lt;SPAN style="COLOR: #2b91af"&gt;DispatcherPriority&lt;/SPAN&gt;.Normal, AppendDelegate, s, &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;[] { color });&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;lock&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Scroller1)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (s != &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/SPAN&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.currentTextBlock.Inlines.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Run&lt;/SPAN&gt;() { Text = s, Foreground = color });&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Scroller1.ScrollToBottom();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; StdoutReceived(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; t)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MyAppend(t, System.Windows.Media.&lt;SPAN style="COLOR: #2b91af"&gt;Brushes&lt;/SPAN&gt;.BlueViolet);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; StderrReceived(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; t)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MyAppend(t, System.Windows.Media.&lt;SPAN style="COLOR: #2b91af"&gt;Brushes&lt;/SPAN&gt;.Red);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Window_Loaded(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt; e)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// creating the shell starts it up&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Powershell&lt;/SPAN&gt;(&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Shell&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt;(StdoutReceived),&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/SPAN&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;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Shell&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #2b91af"&gt;OutputReceived&lt;/SPAN&gt;(StderrReceived));&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitCommand();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Input.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"prompt"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Input.Flush();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;77&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; InitCommand()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;78&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;79&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// add a new textblock for each command&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;80&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; currentTextBlock = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;TextBlock&lt;/SPAN&gt;();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;81&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; currentTextBlock.FontFamily = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;FontFamily&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"Consolas"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;82&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; currentTextBlock.Margin = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Thickness&lt;/SPAN&gt;(0d);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;83&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//currentTextBlock.Foreground = color;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;84&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.OutputPanel.Children.Add(currentTextBlock);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;85&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;86&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;87&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Button_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt; e)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;88&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;89&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitCommand();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;90&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;91&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MyAppend(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.textBox1.Text, System.Windows.Media.&lt;SPAN style="COLOR: #2b91af"&gt;Brushes&lt;/SPAN&gt;.SteelBlue);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;92&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Input.WriteLine(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.textBox1.Text);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;93&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;94&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Input.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"prompt"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;95&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Input.Flush();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;96&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;97&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;98&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Window_Closing(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, System.ComponentModel.&lt;SPAN style="COLOR: #2b91af"&gt;CancelEventArgs&lt;/SPAN&gt; e)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;99&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;100&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Stop();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;101&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;102&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;103&lt;/SPAN&gt;&amp;nbsp;}&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;The full source is attached. Maybe interesting and re-usable&amp;nbsp;for someone who wants to embed Powershell capability into an application. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8376424" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/8376424.ashx" length="17164" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>MSBuild script for compiling all .cs files into a single assembly (DLL or EXE)</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/04/08/msbuild-script-for-compiling-all-cs-files-into-a-single-assembly-dll-or-exe.aspx</link><pubDate>Tue, 08 Apr 2008 18:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8354224</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8354224.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8354224</wfw:commentRss><description>&lt;P&gt;I love Visual Studio, but sometimes I build code using no graphical IDE - just the .NET Framework SDK.&amp;nbsp; I wrote &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2008/03/20/how-to-build-a-rest-app-in-net-with-wcf.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2008/03/20/how-to-build-a-rest-app-in-net-with-wcf.aspx"&gt;an article&lt;/A&gt; not long ago describing how to build a WCF Service using .NET 3.5, and just the SDK.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I've always been a makefile weenie, but msbuild is the new build tool - it really makes sense to me.&amp;nbsp; One of the things that took a little effort for me was figuring out the msbuild script I wanted.&amp;nbsp; Basically I wanted to just compile all the C# code contained in a directory, into a single assembly (EXE or DLL).&amp;nbsp;As I build out an idea, I often will iterate rapidly on an app - introducing and removing C# files as it makes sense to me, and I want the build script to remain the same - just compile whatever files it finds.&lt;/P&gt;
&lt;P&gt;Enclosed here&amp;nbsp;is what I came up with, for my .NET Framework 3.5 SDK environment.&amp;nbsp; Maybe it will work for you, too.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;\red0\green128\blue0;}??\fs20 \cf1 &amp;lt;\cf3 Project\cf1  \cf4 xmlns\cf1 =\cf0 "\cf1 http://schemas.microsoft.com/developer/msbuild/2003\cf0 "\par ??\cf1          \cf4 DefaultTargets\cf1 =\cf0 "\cf1 CompileAll\cf0 "\par ??\cf1          \cf4 ToolsVersion\cf1 =\cf0 "\cf1 3.5\cf0 "\par ??\cf1    &amp;gt;\par ??\par ??  &amp;lt;\cf3 Import\cf1  \cf4 Project\cf1 =\cf0 "\cf1 $(MSBuildToolsPath)\\Microsoft.CSharp.targets\cf0 "\cf1  /&amp;gt;\par ??  &amp;lt;!--\cf6  Import Project="c:\\.net3.5\\Microsoft.Csharp.targets" /    \cf1 --&amp;gt;\par ??\par ??  &amp;lt;\cf3 PropertyGroup\cf1 &amp;gt;\par ??    &amp;lt;!--\cf6  This AppName thing is the base name of your DLL or EXE \cf1 --&amp;gt;\par ??    &amp;lt;\cf3 AppName\cf1 &amp;gt;\cf0 YourAppNameHere\cf1 &amp;lt;/\cf3 AppName\cf1 &amp;gt;\par ??  &amp;lt;/\cf3 PropertyGroup\cf1 &amp;gt;\par ??\par ??  &amp;lt;!--\cf6  This build file compiles each .cs file into its own exe \cf1 --&amp;gt;\par ??  &amp;lt;\cf3 PropertyGroup\cf1  \cf4 Condition\cf1 =\cf0 "\cf1 '$(Configuration)'==''\cf0 "\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Configuration\cf1 &amp;gt;\cf0 Debug\cf1 &amp;lt;/\cf3 Configuration\cf1 &amp;gt;\par ??    &amp;lt;!--\cf6  Default \cf1 --&amp;gt;\par ??  &amp;lt;/\cf3 PropertyGroup\cf1 &amp;gt;\par ??\par ??  &amp;lt;\cf3 PropertyGroup\cf1  \cf4 Condition\cf1 =\cf0 "\cf1 '$(Configuration)'=='Debug'\cf0 "\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Optimize\cf1 &amp;gt;\cf0 false\cf1 &amp;lt;/\cf3 Optimize\cf1 &amp;gt;\par ??    &amp;lt;\cf3 DebugSymbols\cf1 &amp;gt;\cf0 true\cf1 &amp;lt;/\cf3 DebugSymbols\cf1 &amp;gt;\par ??    &amp;lt;!--\cf6  &amp;lt;OutputPath&amp;gt;.\\bin&amp;lt;/OutputPath&amp;gt;  \cf1 --&amp;gt;\par ??    &amp;lt;\cf3 OutputPath\cf1 &amp;gt;\cf0 .\\\cf1 &amp;lt;/\cf3 OutputPath\cf1 &amp;gt;\par ??    &amp;lt;\cf3 OutDir\cf1 &amp;gt;\cf0 .\\\cf1 &amp;lt;/\cf3 OutDir\cf1 &amp;gt;\par ??    &amp;lt;\cf3 IntermediateOutputPath\cf1 &amp;gt;\cf0 .\\\cf1 &amp;lt;/\cf3 IntermediateOutputPath\cf1 &amp;gt;\par ??  &amp;lt;/\cf3 PropertyGroup\cf1 &amp;gt;\par ??\par ??\par ??  &amp;lt;!--\cf6  Specify the inputs by type and file name \cf1 --&amp;gt;\par ??  &amp;lt;\cf3 ItemGroup\cf1 &amp;gt;\par ??    &amp;lt;\cf3 CSFile\cf1  \cf4 Include\cf1 =\cf0 "\cf1 *.cs\cf0 "\cf1 /&amp;gt;\par ??  &amp;lt;/\cf3 ItemGroup\cf1 &amp;gt;\par ??\par ??\par ??  &amp;lt;!--\cf6  specify reference assemblies for all builds in this project \cf1 --&amp;gt;\par ??  &amp;lt;\cf3 ItemGroup\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 mscorlib\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.Core\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.Data\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.Data.Linq\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.ServiceModel\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.ServiceModel.Web\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Reference\cf1  \cf4 Include\cf1 =\cf0 "\cf1 System.Runtime.Serialization\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;!--\cf6  &amp;lt;Reference Include=".\\ObjectDumper.dll" /&amp;gt; \cf1 --&amp;gt;\par ??  &amp;lt;/\cf3 ItemGroup\cf1 &amp;gt;\par ??\par ??\par ??  &amp;lt;\cf3 Target\cf1  \cf4 Name\cf1 =\cf0 "\cf1 CompileAll\cf0 "\par ??\cf1           \cf4 DependsOnTargets\cf1 =\cf0 "\cf1 ResolveAssemblyReferences\cf0 "\par ??\cf1      &amp;gt;\par ??\par ??    &amp;lt;\cf3 Message\cf1  \cf4 Text\cf1 =\cf0 "\cf1 Reference = @(Reference)\cf0 "\cf1  /&amp;gt;\par ??    &amp;lt;\cf3 Message\cf1  \cf4 Text\cf1 =\cf0 "\cf1 ReferencePath = @(ReferencePath)\cf0 "\cf1  /&amp;gt;\par ??\par ??\par ??    &amp;lt;!--\cf6  Message Text="MS Build Tools path:  $(MSBuildToolsPath)" / \cf1 --&amp;gt;\par ??\par ??    &amp;lt;!--\cf6  Run the Visual C# compilation on all the .cs files. \cf1 --&amp;gt;\par ??\par ??    &amp;lt;\cf3 CSC\par ??\cf1        \cf4 Sources\cf1 =\cf0 "\cf1 @(CSFile)\cf0 "\par ??\cf1        \cf4 References\cf1 =\cf0 "\cf1 @(ReferencePath)\cf0 "\par ??\cf1        \cf4 OutputAssembly\cf1 =\cf0 "\cf1 $(OutputPath)\\$(AppName).exe\cf0 "\par ??\cf1        \cf4 EmitDebugInformation\cf1 =\cf0 "\cf1 $(DebugSymbols)\cf0 "\par ??\cf1        \cf4 TargetType\cf1 =\cf0 "\cf1 exe\cf0 "\par ??\cf1        \cf4 Toolpath\cf1 =\cf0 "\cf1 $(MSBuildToolsPath)\cf0 "\par ??\cf1        \cf4 Nologo\cf1 =\cf0 "\cf1 true\cf0 "\par ??\cf1          /&amp;gt;\par ??  &amp;lt;/\cf3 Target\cf1 &amp;gt;\par ??\par ??  &amp;lt;!--\cf6  redefine the Clean target, from the Microsoft.csharp.targets file.  (Last definition wins) \cf1 --&amp;gt;\par ??  &amp;lt;\cf3 Target\cf1  \cf4 Name\cf1 =\cf0 "\cf1 Clean\cf0 "\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Delete\cf1  \cf4 Files\cf1 =\cf0 "\cf1 $(OutputPath)\\$(AppName).exe\cf0 "\cf1 /&amp;gt;\par ??    &amp;lt;\cf3 Delete\cf1  \cf4 Files\cf1 =\cf0 "\cf1 $(OutputPath)\\$(AppName).pdb\cf0 "\cf1 /&amp;gt;\par ??    &amp;lt;\cf3 Delete\cf1  \cf4 Files\cf1 =\cf0 "\cf1 %(CSFile.identity)~\cf0 "\cf1 /&amp;gt;\par ??    &amp;lt;\cf3 Delete\cf1  \cf4 Files\cf1 =\cf0 "\cf1 build.xml~\cf0 "\cf1 /&amp;gt;\par ??  &amp;lt;/\cf3 Target\cf1 &amp;gt;\par ??\par ??&amp;lt;/\cf3 Project\cf1 &amp;gt;\par ??}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;DefaultTargets&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CompileAll&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ToolsVersion&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;3.5&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Import&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(MSBuildToolsPath)\Microsoft.CSharp.targets&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Import Project="c:\.net3.5\Microsoft.Csharp.targets" /&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; This AppName thing is the base name of your DLL or EXE &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;AppName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;YourAppNameHere&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;AppName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; This build file compiles each .cs file into its own exe &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;'$(Configuration)'==''&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Configuration&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Debug&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Configuration&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Default &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;'$(Configuration)'=='Debug'&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Optimize&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;false&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Optimize&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DebugSymbols&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DebugSymbols&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &amp;lt;OutputPath&amp;gt;.\bin&amp;lt;/OutputPath&amp;gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OutputPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;.\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OutputPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OutDir&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;.\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OutDir&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;IntermediateOutputPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;.\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;IntermediateOutputPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Specify the inputs by type and file name &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;CSFile&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;*.cs&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; specify reference assemblies for all builds in this project &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;mscorlib&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.Core&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.Data&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.Data.Linq&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.ServiceModel&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.ServiceModel.Web&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Reference&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Include&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;System.Runtime.Serialization&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &amp;lt;Reference Include=".\ObjectDumper.dll" /&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ItemGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CompileAll&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;DependsOnTargets&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ResolveAssemblyReferences&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Message&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Reference = @(Reference)&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Message&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ReferencePath = @(ReferencePath)&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Message Text="MS Build Tools path:&amp;nbsp; $(MSBuildToolsPath)" / &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Run the Visual C# compilation on all the .cs files. &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;CSC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Sources&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;@(CSFile)&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;References&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;@(ReferencePath)&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;OutputAssembly&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(OutputPath)\$(AppName).exe&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;EmitDebugInformation&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(DebugSymbols)&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;exe&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Toolpath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(MSBuildToolsPath)&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Nologo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; redefine the Clean target, from the Microsoft.csharp.targets file.&amp;nbsp; (Last definition wins) &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Clean&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Files&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(OutputPath)\$(AppName).exe&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Files&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;$(OutputPath)\$(AppName).pdb&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;77&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Files&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;%(CSFile.identity)~&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;78&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Files&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;build.xml~&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;79&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;80&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;81&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;To use it, run this:&lt;BR&gt;&lt;FONT family="Courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c:\windows\Microsoft.NET\Framework\v3.5\msbuild.exe build.xml &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8354224" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/MSBuild/default.aspx">MSBuild</category></item><item><title>Don't Believe Everything you Read on Wikipedia, especially about C# Anonymous Functions</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/03/31/don-t-believe-everything-you-read-on-wikipedia-especially-about-c-anonymous-functions.aspx</link><pubDate>Mon, 31 Mar 2008 17:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8341266</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8341266.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8341266</wfw:commentRss><description>&lt;P&gt;I was reading Wikipedia the other day, and saw this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A title="C Sharp (programming language)" href="http://cc.msnscache.com/wiki/C_Sharp_%28programming_language%29"&gt;C#&lt;/A&gt; has partial anonymous function support through the use of &lt;A title="Delegate (.NET)" href="http://cc.msnscache.com/wiki/Delegate_%28.NET%29"&gt;delegates&lt;/A&gt;. ...&amp;nbsp;Since anonymous methods are not nameless and can only be declared inside methods of classes then C# does not support full anonymous functionality.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmph, who's in charge here?&amp;nbsp; I don't really feel any ownership for Wikipedia, but that is just bad info.&amp;nbsp; So I rewrote it. &lt;/P&gt;
&lt;P&gt;The updated entry, including the comments on C#, is here: &lt;A href="http://en.wikipedia.org/wiki/Anonymous_function"&gt;http://en.wikipedia.org/wiki/Anonymous_function&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you want to read all about the anonymous function support added in C# v3.0, then go the &lt;EM&gt;the source&lt;/EM&gt; - &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb882516.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb882516.aspx"&gt;MSDN&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Leads me to a couple other notes here. &lt;/P&gt;
&lt;P&gt;First, yes, I agree it is a pain that the language compiler version has a different version than the framework.&amp;nbsp; So we have C# 3.0, but it shipped with the .NET Framework v3.5.&amp;nbsp; Confused?&amp;nbsp; You should be.&amp;nbsp; All I can say is, we apologize.&amp;nbsp; there are good reasons we are confusing you.&amp;nbsp; We're not doing it on purpose, it just works out that way. &lt;/P&gt;
&lt;P&gt;Second, at first I approached the new C# language stuff with a little trepidation.&amp;nbsp; I mean, lambdas?&amp;nbsp; Extension methods?&amp;nbsp; All of this stuff sounds a little esoteric.&amp;nbsp; But after exploring a little bit, I have found good uses for these new language constructs, even outside the coolness that is LINQ.&amp;nbsp; It's the little things.&amp;nbsp; For example, I can convert a version string like 1.2.3.4 into a List&amp;lt;int&amp;gt; with a single line of code, using the ConvertAll() method and a lambda expression. &lt;/P&gt;
&lt;P&gt;That kind of thing is just pretty cool.&amp;nbsp;&amp;nbsp; Also I use the object initializers all the time now. &lt;/P&gt;
&lt;P&gt;Last, I wonder how much of the wikipedia thing works this way - people just feel like they don't want bad info out there, and are sort of transparently taxed into writing the articles themselves.&amp;nbsp; This is sort of like trash collection in Seattle.&amp;nbsp; When I lived in Pennsylvania, trash collection was just included in the taxes, and you could throw anything away.&amp;nbsp; I could put a used car on the curb with a note on the windshield saying "Trash", and the trash man would come and haul it away.&amp;nbsp; But in the Seattle area, you can't throw &lt;EM&gt;just anything &lt;/EM&gt;away.&amp;nbsp;&amp;nbsp; There's a limit.&amp;nbsp;&amp;nbsp; If you want to discard an appliance, for example, you have to take it to the dump yourself.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There's something to be said for the Pennsylvania model - basically it means that there's no reason to be a "bad actor" and throw trash out in an empty lot.&amp;nbsp; Whatever you want to throw out, they'll haul away.&amp;nbsp; It's taken care of for you.&amp;nbsp; (Like Encyclopedia Britannica).&amp;nbsp; On the other hand the Seattle approach means people who discard a lot of stuff, have to pay more, and make more of an effort.&amp;nbsp; (like Wikipedia). &lt;/P&gt;
&lt;P&gt;Well I'm obviously rambling now. . .&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8341266" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category></item><item><title>Simple Auto Update, auto patch, for WPF Apps, without the Updater Block</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/03/28/simple-auto-update-for-wpf-apps.aspx</link><pubDate>Fri, 28 Mar 2008 18:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8340571</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8340571.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8340571</wfw:commentRss><description>&lt;P&gt;I am writing some smaller WPF apps, and I want them to automatically update themselves, or automatically patch themselves,&amp;nbsp;something like &lt;A href="http://www.aisto.com/roeder/" mce_href="http://www.aisto.com/roeder/"&gt;Lutz Roeder's&lt;/A&gt; &lt;A href="http://www.aisto.com/roeder/dotnet/" mce_href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector&lt;/A&gt;&amp;nbsp;or &lt;A href="http://www.getpaint.net/" mce_href="http://www.getpaint.net/"&gt;Paint.NET&lt;/A&gt; does.&amp;nbsp;&amp;nbsp;&amp;nbsp;Scott Hanselman has &lt;A href="http://www.hanselman.com/blog/MakingYourApplicationAutomaticallyUpdateItself.aspx" mce_href="http://www.hanselman.com/blog/MakingYourApplicationAutomaticallyUpdateItself.aspx"&gt;commented on this previously&lt;/A&gt;, and he's right. Every app ought to be able to do this. &lt;/P&gt;
&lt;P&gt;I looked into the Application Update Block, which was last updated I think in 2005, and is at version 2.0.&amp;nbsp; This is a thorough application block (a body of reusable code) that seems to do "everything".&amp;nbsp; But it's a little too much for me.&amp;nbsp; It requires the .NET&amp;nbsp;Enterprise Library, which is free, but a lot of extra code. It all feels like too much work.&amp;nbsp; Too much configuration, too many options, too much flexibility.&amp;nbsp;&amp;nbsp; It's too much for what I want.&lt;/P&gt;
&lt;P&gt;My apps are small, single EXEs, no installation, no config files, and so on.&amp;nbsp; This is a very very simple scenario.&amp;nbsp; The Updater Block is overkill. &lt;/P&gt;
&lt;P&gt;I looked into using AppDomains and getting fancy that way, but I didn't like that approach either. Too complicated, too unnecessary.&amp;nbsp; The AppDomain is a nice structure if I want the process to continue living through the update lifecycle.&amp;nbsp; But I&amp;nbsp;don't need the process&amp;nbsp;to live forever.&amp;nbsp; I don't care about re-cycling the process.&amp;nbsp; So AppDomains seem like the wrong approach too. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also looked around for some biolerplate code produced by someone else, something I could re-use.&amp;nbsp; But I couldn't find anything accessible.&amp;nbsp; I think there are commercial third-party components that do this, but this was just for some really basic apps, I didn't want a commercial solution.&amp;nbsp; So, I built it myself. &lt;/P&gt;
&lt;H3&gt;A Simple Approach to Self Patching Apps&lt;/H3&gt;
&lt;P&gt;There are really two steps to the auto-update, or auto-patch trick.&amp;nbsp; &amp;nbsp;First is to find out the latest version of the app, Second is to get the latest version and replace the old version with your new version.&amp;nbsp; The first problem is simple, just an HTTP GET (in the REST tradition) on a text file containing the version number. The second problem is more challenging. &lt;/P&gt;
&lt;P&gt;The EXE starts up, and it can do the HTTP GET to find out it needs to be updated.&amp;nbsp; But then what?&amp;nbsp; Of course, the app could go get the updated version of the app image, with the same kind of&amp;nbsp;HTTP GET.&amp;nbsp; For a reasonably sized app (let's say up to 1mb EXE image size), this will be reasonably fast, well within the realm of acceptable performance.&amp;nbsp;Even for a&amp;nbsp;20mb download, it's still acceptable.&amp;nbsp; BUT, while the EXE is running, the EXE Image on disk is locked.&amp;nbsp; It cannot be overwritten. This second problem is trickier.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I settled on was this: have the executing application replicate itself.&amp;nbsp; The App starts up.&amp;nbsp; Let's say it runs in process 1.&amp;nbsp; checks for available updates.&amp;nbsp; If it finds an update, it replicates - copies its EXE image to another location, a temporary location.&amp;nbsp; The original &amp;nbsp;process then does a Process.Start() on that copy of the EXE, we now have process #2.&amp;nbsp;&amp;nbsp; Then the original process (#1) exits!.&amp;nbsp;&amp;nbsp; This unlocks the original EXE image on disk, so that it can be overwritten.&amp;nbsp;&amp;nbsp; The process running from the temporary copy location, now downloads the latest, updated EXE image, and copies it to the original location.&amp;nbsp; The&amp;nbsp;Updater clone process then&amp;nbsp;does a Process.Start() on the original EXE location.&amp;nbsp; This creates process #3. &amp;nbsp;Then Process #2 exits.&amp;nbsp;&amp;nbsp;When process #3 starts up, it checks for updates and finds none, since it is the running from the latest EXE image. Process #3&amp;nbsp; then tries to clean up any EXE "updater clone" images - this last step is just good manners and not strictly necessary for correctness. &lt;/P&gt;
&lt;P&gt;This should work with any WPF application.&amp;nbsp; The approach will also work for WinForms applications, but the code I have here, will not. &lt;/P&gt;
&lt;P&gt;Here's what the code looks like in your app; you embed this in the code-behind of your WPF Window class:&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; PADDING-BOTTOM: 2pt; LINE-HEIGHT: 98%; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Consolas,Courier New; BACKGROUND: white; COLOR: black; FONT-SIZE: 9pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: windowtext 1pt solid; PADDING-TOP: 2pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous"&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: rgb(160,32,240)"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;Window1&lt;/SPAN&gt; : Window&lt;BR&gt;{&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;public&lt;/SPAN&gt; Window1()&lt;BR&gt;    {&lt;BR&gt;        InitializeComponent();&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;if&lt;/SPAN&gt; (UpdaterCheck())&lt;BR&gt;            &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;this&lt;/SPAN&gt;.Hide();&lt;BR&gt;    }&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(95,158,160)"&gt;Ionic&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(95,158,160)"&gt;AppUpdater&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(95,158,160)"&gt;Wpf&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(34,139,34)"&gt;Updater&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;_updater&lt;/SPAN&gt;; &lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;string&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;_manifestUrl&lt;/SPAN&gt; =&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://example.org/AppUpdates/MyApplication/Manifest.xml"&lt;/SPAN&gt;;&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;string&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;_infoUrl&lt;/SPAN&gt; = &lt;BR&gt;        &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://example.org/MyApplication.html"&lt;/SPAN&gt;;&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;string&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;_description&lt;/SPAN&gt; =&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"MyApplication is a delightful application; it does x, y, and z. "&lt;/SPAN&gt; +&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"It uses the Ionic AppUpdater module for WPF for auto-update "&lt;/SPAN&gt; +&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"capability."&lt;/SPAN&gt;;&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(178,34,34)"&gt;// &lt;/SPAN&gt;&lt;SPAN style="COLOR: rgb(178,34,34)"&gt;Obtain the publicKey XML from the ManifestTool that ships with Ionic AppUpdater.&lt;BR&gt;&lt;/SPAN&gt;    &lt;SPAN style="COLOR: rgb(178,34,34)"&gt;// &lt;/SPAN&gt;&lt;SPAN style="COLOR: rgb(178,34,34)"&gt;The following string is Ionic's public key.  You will need a different one.&lt;BR&gt;&lt;/SPAN&gt;    &lt;SPAN style="COLOR: rgb(178,34,34)"&gt;// &lt;/SPAN&gt;&lt;SPAN style="COLOR: rgb(178,34,34)"&gt;Consult the Readme for more information. &lt;BR&gt;&lt;/SPAN&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;string&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;_publicKeyXml&lt;/SPAN&gt; = &lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"&amp;lt;RSAKeyValue&amp;gt;&amp;lt;Modulus&amp;gt;sZqhvF0KX6m4blah..blah...=&amp;lt;/Modulus&amp;gt;&amp;lt;Exponent&amp;gt;AQAB&amp;lt;/Exponent&amp;gt;&amp;lt;/RSAKeyValue&amp;gt;"&lt;/SPAN&gt;;&lt;BR&gt;    &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(34,139,34)"&gt;bool&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;UpdaterCheck&lt;/SPAN&gt;()&lt;BR&gt;    {&lt;BR&gt;        _updater = &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(95,158,160)"&gt;Ionic&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(95,158,160)"&gt;AppUpdater&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(95,158,160)"&gt;Wpf&lt;/SPAN&gt;.Updater(&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"This is MyApplication."&lt;/SPAN&gt;,&lt;BR&gt;                                                    _infoUrl,&lt;BR&gt;                                                    _description,&lt;BR&gt;                                                    _manifestUrl,&lt;BR&gt;                                                    _publicKeyXml);&lt;BR&gt;        &lt;SPAN style="COLOR: rgb(160,32,240)"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(95,158,160)"&gt;_updater&lt;/SPAN&gt;.&lt;SPAN style="COLOR: rgb(95,158,160)"&gt;Status&lt;/SPAN&gt;.IsUpdating; &lt;BR&gt;    }&lt;BR&gt;    ...   &lt;BR&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;When this runs, the Updater() will check for updates and will inform the user if a more recent version is available. &amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;When it starts up, the&amp;nbsp;sample app looks like this &amp;nbsp;:&lt;/P&gt;&lt;IMG alt="auto updating app" src="http://cheeso.members.winisp.net/images/MyApplication.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Not very fancy. But this is just an example. It can be any WPF application. If there is an update, then automatically, this UI is presented:&lt;/P&gt;&lt;IMG alt="update notification" src="http://cheeso.members.winisp.net/images/MyApplication-Update.png"&gt; 
&lt;P&gt;This UI is not something you have to code;&amp;nbsp; It is generated by the AppUpdater module, based on strings your app passes in to the AppUpdater constructor.&amp;nbsp; If the user clicks the "Get Update" button, then the app automatically begins downloading.&amp;nbsp; There's no code required for that, either. &amp;nbsp;&amp;nbsp; It looks like this:&amp;nbsp; &lt;/P&gt;&lt;IMG alt="update progress" src="http://cheeso.members.winisp.net/images/MyApplication-Progress.png"&gt; 
&lt;P&gt;You don't have to code any of this. &lt;/P&gt;
&lt;P mce_keep="true"&gt;When the download completes, that window disappears, and then the app starts up again.&amp;nbsp; It all happens pretty fast for a small app.&amp;nbsp; For my sample app of around 28k, it happens in less than a second.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, in general, people will want different user interaction models.&amp;nbsp; The code above will nag the user, every time the app starts. You might want to be more in the background - and only tell the user if there is an update when they ask. Maybe you notify about updates based on a click on a menu item, maybe it's a button click.&amp;nbsp; This is easy to do, too. Just put the call to the Updater() constructor in the code-behind for the button or menu item. The UI will look the same. &lt;/P&gt;
&lt;P mce_keep="true"&gt;I hope this is useful.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The source is attached here.&amp;nbsp; It is all C#.&amp;nbsp; This requires the .NET Framework v3.5, and WPF. &lt;/P&gt;
&lt;H3&gt;Hmmm, what about Security?&amp;nbsp;&lt;/H3&gt;
&lt;P mce_keep="true"&gt;My first crack at this just used a text file holding the Version tuple (1.2.3.4), and if the version was different, the app would download itself and there ya go.&amp;nbsp; But the security of that approach was pretty loose.&amp;nbsp; I saw an &lt;A href="http://www.belshe.com/2004/01/22/security-for-self-patching-software/" mce_href="http://www.belshe.com/2004/01/22/security-for-self-patching-software/"&gt;older comment&lt;/A&gt; from some guy named Mike, who described an approach to signing an XML manifest file, and including an MD5 hash in that manifest.&amp;nbsp; So I adopted that approach (except I use a SHA256 hash).&amp;nbsp; I used this &lt;A href="http://www.codeproject.com/KB/security/xmldsiglic.aspx" mce_href="http://www.codeproject.com/KB/security/xmldsiglic.aspx"&gt;codeproject article&lt;/A&gt; as a hint for how to sign the XML and verify the signatures.&lt;/P&gt;
&lt;P&gt;The tool emits a signed XML manifest that looks like this: &lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; PADDING-BOTTOM: 2pt; LINE-HEIGHT: 98%; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Consolas,Courier New; BACKGROUND: white; COLOR: black; FONT-SIZE: 9pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: windowtext 1pt solid; PADDING-TOP: 2pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;UpdateInfo&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"urn:Ionic.Apps.Updates"&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;LatestAvailableVersion&lt;/SPAN&gt;&amp;gt;1.2.5.4&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;LatestAvailableVersion&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;ImageName&lt;/SPAN&gt;&amp;gt;MyApplication.exe&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;ImageName&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;AssemblyFullName&lt;/SPAN&gt;&amp;gt;MyApplication, Version=1.2.5.4, Culture=neutral, PublicKeyToken=null&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;AssemblyFullName&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;TimeStamp&lt;/SPAN&gt;&amp;gt;2009-08-11T02:31:43.2320026-04:00&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;TimeStamp&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Hash&lt;/SPAN&gt;&amp;gt;8BA50BC233CB70478E04D6A740358E3DD0F30C78988BFC22D4AC58A8D777A8FE&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Hash&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;HashType&lt;/SPAN&gt;&amp;gt;System.Security.Cryptography.SHA256CryptoServiceProvider&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;HashType&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;DownloadLocation&lt;/SPAN&gt;&amp;gt;http://example.org/AppUpdates/MyApplication/MyApplication.exe&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;DownloadLocation&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Signature&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://www.w3.org/2000/09/xmldsig#"&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;    &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;SignedInfo&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;      &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;CanonicalizationMethod&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;Algorithm&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"&lt;/SPAN&gt; /&amp;gt;&lt;BR&gt;      &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;SignatureMethod&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;Algorithm&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://www.w3.org/2000/09/xmldsig#rsa-sha1"&lt;/SPAN&gt; /&amp;gt;&lt;BR&gt;      &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Reference&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;URI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;""&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;        &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Transforms&lt;/SPAN&gt;&amp;gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Transform&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;Algorithm&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://www.w3.org/2000/09/xmldsig#enveloped-signature"&lt;/SPAN&gt; /&amp;gt;&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Transforms&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;        &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;DigestMethod&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(184,134,11)"&gt;Algorithm&lt;/SPAN&gt;=&lt;SPAN style="COLOR: rgb(188,143,143)"&gt;"http://www.w3.org/2000/09/xmldsig#sha1"&lt;/SPAN&gt; /&amp;gt;&amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;DigestValue&lt;/SPAN&gt;&amp;gt;cUxRXJ0lcVcAB7cdWkRdyggAVEM=&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;DigestValue&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;      &amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Reference&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;      &amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;SignedInfo&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;      &amp;lt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;SignatureValue&lt;/SPAN&gt;&amp;gt;CheE/WCcHvbsZr9Y3ACpX4Wqp9e/0cpUpEE6JYtjl2dZdr606xIcGsouUnjOBNfEPs02neRIuVMrGMCo/4ImkbSlprroQY6/Yd9ne7LXytBd1/5+RfJzHoKMM7/Nnoc2A3eP7wBpEtGgMJZ3VFrDHxLRJSpaEKpWdOPO6EIEmGk=&lt;BR&gt;      &amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;SignatureValue&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;  &amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;Signature&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;UpdateInfo&lt;/SPAN&gt;&amp;gt;&lt;BR&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The source for the Updater module, as well as a sample app demonstrating its use, and the manifest tool, is all attached here. &lt;/P&gt;
&lt;P mce_keep="true"&gt;This really has nothing to do with Interop, but it's a handy thing to have.&amp;nbsp; Now, go and be cool, and build self-patching, auto-updating applications. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8340571" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/8340571.ashx" length="37036" type="application\x-zip-compressed" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XMLDSIG/default.aspx">XMLDSIG</category></item><item><title>My Vista Experience just got sooooo much better</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/03/22/my-vista-experience-just-got-sooooo-much-better.aspx</link><pubDate>Sat, 22 Mar 2008 22:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8331504</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8331504.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8331504</wfw:commentRss><description>&lt;FONT family="Calibri"&gt;&lt;SIZE=3&gt;
&lt;P&gt;Quietly I've been suffering through an experience with Windows Vista on my laptop.&amp;nbsp; I got my laptop, &lt;A class="" href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&amp;amp;cc=us&amp;amp;objectID=c01063949&amp;amp;jumpid=reg_R1002_USEN#N10010" mce_href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&amp;amp;cc=us&amp;amp;objectID=c01063949&amp;amp;jumpid=reg_R1002_USEN#N10010"&gt;a HP/Compaq nc8430&lt;/A&gt;, in October 2006 and had been running Vista on it since then.&amp;nbsp; In the early days, I used a pre-release version of vista, but I switched to the generally-released (RTM) version as soon as it was available.&lt;/P&gt;
&lt;P&gt;The laptop is a nice piece of hardware - it's got a huge, bright 1680x1050 screen, a solid keyboard, a touchpad and a mouse stick (nipple?).&amp;nbsp; It's got good sound, a 100gb hard drive, a fast processor.&amp;nbsp; I got the spare battery.&amp;nbsp; IT also has a fingerprint scanner, built-in reader for smartcards and SD storage, 3 USB ports, built-in Bluetooth and 802.11g wireless networking.&amp;nbsp; Also it's solid, built like a tank. As a "work machine" it's not what you would call "exciting".&amp;nbsp; It doesn't have flashy looks or wafer-thin profile (and the slim battery life to go with it).&amp;nbsp; It's not as light as a feather, but I'm a big guy and I can handle the heft, whatever it is.&amp;nbsp; It never bothered me.&amp;nbsp; Overall, I am very pleased with the hardware.&lt;/P&gt;
&lt;H3&gt;Who's Driving This Thing?&lt;/H3&gt;
&lt;P&gt;The problems I had with Vista on this machine started early.&amp;nbsp; I did not have an OEM-blessed install of the OS on the machine, and some device drivers were lacking.&amp;nbsp; The fingerprint reader, I think was one of them.&amp;nbsp; Also the function keys - like the one to turn on and off the wireless network, or the one to flip the machine into presentation mode - also lacked Vista-compatible drivers.&amp;nbsp; There's a mobile data protection thing in the hard drive - an accelerometer that protects the hard drive from sudden drops - that one also did not work.&amp;nbsp; Lots of people may doubt the value in the mobile data protection thing, but I experienced a data loss first hand from sudden laptop droppage.&amp;nbsp; It happened with my old IBM Thinkpad - I dropped it on a bed, a BED mind you!&amp;nbsp; in a hotel room while I was travelling.&amp;nbsp; The laptop immediately experienced drive errors and it was never the same since then.&amp;nbsp; So I totally understand the value. Anyway, the driver for the accelerometer on the hard drive was lacking for Vista. &lt;/P&gt;
&lt;P&gt;As a result I was using a slightly crippled install - some drivers were totally lacking, and for other devices, I installed WinXP-compatible drivers and winced as I ok'd through the "are you sure&amp;nbsp; you want to do this?" dialogs.&amp;nbsp; And the user experience resulting from the mishmash of drivers was accordingly poor. I'd get bluescreens with the accelerometer stuff.&amp;nbsp; I'd have trouble waking up and hibernating.&amp;nbsp; Some ordering of hibernate, sleep, wakeup, and re-sleep would cause my PC to just shut down completely. There's never a good time for your laptop to just turn off.&amp;nbsp; But it happened a couple times a week to me.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I signed up for HP's driver alert email, so I would know about the latest releases of drivers for the thing.&amp;nbsp; But the emails I got several times per week seemed to have a lot of noise - alerts about new marketing programs and stuff I just did not need to know about. As a result I stopped reading the emails and was in the dark as to when the drivers were being updated.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When I had the time and energy,&amp;nbsp;I would manually &lt;A class="" href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&amp;amp;cc=us&amp;amp;prodNameId=1839197&amp;amp;prodTypeId=321957&amp;amp;prodSeriesId=1839150&amp;amp;swLang=8&amp;amp;taskId=135&amp;amp;swEnvOID=2096" mce_href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&amp;amp;cc=us&amp;amp;prodNameId=1839197&amp;amp;prodTypeId=321957&amp;amp;prodSeriesId=1839150&amp;amp;swLang=8&amp;amp;taskId=135&amp;amp;swEnvOID=2096"&gt;visit the HP site to check for new drivers&lt;/A&gt;, and wouldn't you know it, every time I visited there would be new and updated drivers.&amp;nbsp; Monthly, sometimes more often, I would update the machine, crossing my fingers, hoping, hoping!&amp;nbsp; that somehow, please please please, finally the PC would be working the way it ought to, the way my WinXP SP2 machines were running - solid!&amp;nbsp; But while the various problems changed or morphed, they never seemed to go away. &lt;/P&gt;
&lt;H3&gt;AC power = A Useless Machine &lt;/H3&gt;
&lt;P&gt;One of the nastiest problems was with disconnecting and re-connecting from AC power.&amp;nbsp; It seemed that every time I connected to AC power, the hard drive would thrash for 10 minutes and the machine would essentially become useless.&amp;nbsp; Apparently this &lt;A class="" href="http://search.msn.com/results.aspx?q=disk+thrash+vista&amp;amp;form=QBRE" mce_href="http://search.msn.com/results.aspx?q=disk+thrash+vista&amp;amp;form=QBRE"&gt;disk thrash was not an unusual user experience&lt;/A&gt;. If I was low on battery and walked into a meeting, I'd be forced to plug into AC, and then endure the 10 minutes (no kidding, 10 full minutes) of PC uselessness. I searched and searched and never could diagnose this problem.&amp;nbsp; I &lt;A class="" href="http://search.msn.com/results.aspx?q=%22search+indexing%22+vista&amp;amp;form=QBRE" mce_href="http://search.msn.com/results.aspx?q=%22search+indexing%22+vista&amp;amp;form=QBRE"&gt;turned off Vista search indexing&lt;/A&gt;, thinking it was that. (this was a huge setback in user experience).&amp;nbsp; I imagined it was some&amp;nbsp;combination of poor device drivers coupled with&amp;nbsp;heavy disk use. I turned off Sidebar.&amp;nbsp; I turned off everything I could find, trying to minimize stress on the machine. I &lt;A class="" href="http://search.msn.com/results.aspx?q=disable+superfetch+vista&amp;amp;FORM=QBHP" mce_href="http://search.msn.com/results.aspx?q=disable+superfetch+vista&amp;amp;FORM=QBHP"&gt;disabled superfetch&lt;/A&gt;.&amp;nbsp; Nothing solved it.&amp;nbsp; Finally I resorted to planning my business day around hooking up to AC power.&amp;nbsp; I could do it before lunch.&amp;nbsp; I could do it in evening just before I left for home.&amp;nbsp; Living like this was utterly stupid.&lt;/P&gt;
&lt;P&gt;I was hoping that Vista SP1 would solve the problem for me.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;The Tide Turns&lt;/H3&gt;
&lt;P&gt;In early December 2007 I went through a huge batch of HP driver updates.&amp;nbsp; Slowly the problems lessened, it seemed.&amp;nbsp; Then in January I did it again, found a whole new batch of updates. Once more in early March I did it again.&amp;nbsp; For the first time there was a BIOS update for the machine!&amp;nbsp; Whoo-hoo!&amp;nbsp; With all the updates, things were looking good:&amp;nbsp; The bluescreens on hibernate/sleep/unsleep/sleep went away.&amp;nbsp;&amp;nbsp; The accelerometer started working.&amp;nbsp; The function keys started working.&amp;nbsp; Then one night earlier this week I dedicated some time to diagnosing the final remaining annoyance: the hard-drive-spin-up-when-on-AC-power thing. &amp;nbsp; Turns out, all along, it was a Defrag task.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In the &lt;A class="" href="http://search.msn.com/results.aspx?q=vista+%22task+scheduler%22&amp;amp;form=QBRE" mce_href="http://search.msn.com/results.aspx?q=vista+%22task+scheduler%22&amp;amp;form=QBRE"&gt;Task scheduler for Vista&lt;/A&gt;, there's a bunch of settings - one that says "don't do this task while on battery power" and another that says "do this task as soon as you are able".&amp;nbsp; (it is worded as "Run task as soon as possible after a scheduled start is missed").&amp;nbsp; My weekly full defrag was set to run at 3am on Thursday morning.&amp;nbsp; Sometimes the machine would be OFF at that time, so as soon as I turned it on, and plugged it into AC power, the defrag would start.&amp;nbsp; And it would hammer the disk.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;I &lt;A class="" href="http://search.msn.com/results.aspx?q=defrag+vista+scheduler&amp;amp;FORM=QBHP" mce_href="http://search.msn.com/results.aspx?q=defrag+vista+scheduler&amp;amp;FORM=QBHP"&gt;looked into it&lt;/A&gt;, and found &lt;A class="" href="http://www.watchingthenet.com/disable-change-auto-defrag-in-windows-vista.html" mce_href="http://www.watchingthenet.com/disable-change-auto-defrag-in-windows-vista.html"&gt;an article&lt;/A&gt; that guided me through some of the possibilities in adjusting the task schedules. Just turning off the "Run task as soon as possible after a scheduled start is missed" checkbox avoided a world of hurt for me.&amp;nbsp; &lt;EM&gt;This should never be the default option on a laptop,&lt;/EM&gt; in my opinion. &amp;nbsp;&lt;/P&gt;
&lt;H3&gt;I'm in Love.&amp;nbsp; Again! &lt;/H3&gt;
&lt;P&gt;I am proud to say, I now love my laptop again. I love my laptop more than I ever thought I could. Things are better than ever between us!&lt;/P&gt;
&lt;P&gt;Listen, for those of you who doubt, for those of you who go through hell in your relationship... let me tell you, it does get better.&amp;nbsp; You go through dark days, thinking, I need to get out of this relationship!&amp;nbsp; I can't take it anymore!&amp;nbsp; But then the other half of you is saying, "what about all I've invested in it?&amp;nbsp; If we somehow got over this rough spot, we could still have a beautiful future together!"&amp;nbsp; It all seems an impossible dream.&amp;nbsp; Well, I'm here to tell you, that &lt;EM&gt;things can get better&lt;/EM&gt;. Even when things look darkest, it is still possible to recover and get to a happy place.&amp;nbsp; It is possible to Find Love Again!&lt;/P&gt;
&lt;P mce_keep="true"&gt;Ok, off to install &lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=B0C7136D-5EBB-413B-89C9-CB3D06D12674&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=B0C7136D-5EBB-413B-89C9-CB3D06D12674&amp;amp;displaylang=en"&gt;Vista SP1&lt;/A&gt; !&lt;/P&gt;
&lt;P mce_keep="true"&gt;ps: I still have superfetch turned off. &lt;/P&gt;&lt;/SIZE&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8331504" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Gates Center at Carnegie Mellon</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/12/22/gates-center-at-carnegie-mellon.aspx</link><pubDate>Sat, 22 Dec 2007 15:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6835410</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/6835410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=6835410</wfw:commentRss><description>&lt;P&gt;I visited my alma mater, &lt;A href="http://en.wikipedia.org/wiki/Carnegie-Mellon_University" mce_href="http://en.wikipedia.org/wiki/Carnegie-Mellon_University"&gt;Carnegie Mellon&lt;/A&gt; last weekend. Met up with some fellow alums who came in from out of town, including Brendan, Scott, and Brian, pictured here. We're checking out the construction site for the Gates Center at Carnegie Mellon. This was enabled by &lt;A href="http://www.cmu.edu/cmnews/extra/040914_gates.html" mce_href="http://www.cmu.edu/cmnews/extra/040914_gates.html"&gt;a grant&lt;/A&gt; from the Bill &amp;amp; Melinda Gates Foundation to the university. It's the first time I had seen the project. &lt;/P&gt;
&lt;P&gt;&lt;IMG height=617 alt="Brendan, Scott, and Brian viewing the construction site of the Gates Center at Carnegie Mellon" src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_0452_GatesCenter1.jpg" width=823 mce_src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_0452_GatesCenter1.jpg"&gt; &lt;/P&gt;
&lt;P&gt;&lt;IMG height=617 alt="Brendan, Scott, and Brian viewing the construction site of the Gates Center at Carnegie Mellon" src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_1252_GatesCenter1.jpg" width=823 mce_src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_1252_GatesCenter1.jpg"&gt; &lt;/P&gt;
&lt;P&gt;Here's a view of the construction site itself. Pictured in the background are Wean Hall and Doherty Hall. &lt;/P&gt;
&lt;P&gt;&lt;IMG height=617 alt="The construction site of the Gates Center at Carnegie Mellon" src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_1252_GatesCenter2.jpg" width=823 mce_src="http://blogs.msdn.com/blogfiles/dotnetinterop/122207_1252_GatesCenter2.jpg"&gt; &lt;/P&gt;
&lt;P&gt;You can read about the details of the project on the Wikipedia article. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6835410" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category></item><item><title>VS2005 support for SQL 2008 CTP5</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/11/20/vs2005-support-for-sql-2008-ctp5.aspx</link><pubDate>Wed, 21 Nov 2007 02:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6446851</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/6446851.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=6446851</wfw:commentRss><description>&lt;FONT face=Calibri color=#0000ff size=3&gt;&lt;SPAN style="COLOR: #1f497d"&gt;
&lt;P&gt;&lt;B&gt;&lt;SPAN style="COLOR: #1f497d"&gt;Visual Studio 2005 Support for SQL Server 2008 CTP is now publicly available.&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Download Center links:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=3bf4c5ca-b905-4ebc-8901-1d4c1d1da884&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=3bf4c5ca-b905-4ebc-8901-1d4c1d1da884&amp;amp;displaylang=en"&gt;SQL Server 2008 CTP, November 2007&lt;/A&gt;&amp;nbsp;- this is the "Community Tech Preview" (CTP5) of SQL 2008. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&amp;amp;displaylang=en"&gt;Visual Studio 2005 Support for SQL Server 2008, CTP&lt;/A&gt;&amp;nbsp; - this is the patch you can apply to Visual Studio 2005, to allow it to connect to the SQL 2008 CTP5. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The&amp;nbsp;Microsoft team is now working on a similar patch for VS 2008.&amp;nbsp; Stay tuned!&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6446851" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/VS2005/default.aspx">VS2005</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/SQL/default.aspx">SQL</category></item><item><title>Keeping it real on SOA</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/10/02/keeping-it-real-on-soa.aspx</link><pubDate>Tue, 02 Oct 2007 17:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5234269</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/5234269.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=5234269</wfw:commentRss><description>&lt;P&gt;Bobby Wolfe of IBM told no lies when &lt;A class="" href="http://www.ibm.com/developerworks/webservices/library/ws-soa-esbarch/index.html" mce_href="http://www.ibm.com/developerworks/webservices/library/ws-soa-esbarch/index.html"&gt;he said&lt;/A&gt; that &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Clients often want to build only an ESB, because that involves a technology challenge without the need for messy business requirements. Building just an ESB becomes an IT field of dreams, where IT builds an ESB and then hopes some SOA will come along and use it. Such an ESB-oriented architecture loses the benefits of SOA. It doesn't create business value. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A class="" title="David Linthicum Blog on Infoworld" href="http://weblog.infoworld.com/realworldsoa/" target=_blank mce_href="http://weblog.infoworld.com/realworldsoa/"&gt;&lt;FONT color=#0065e2&gt;David Linthicum&lt;/FONT&gt;&lt;/A&gt;, an analyst who writes for infoWorld, &lt;A class="" href="http://weblog.infoworld.com/realworldsoa/archives/2007/08/ibm_aesboriente.html" mce_href="http://weblog.infoworld.com/realworldsoa/archives/2007/08/ibm_aesboriente.html"&gt;agrees&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;The truth seems to finally be coming out…&lt;SPAN style="TEXT-DECORATION: underline"&gt;&lt;STRONG&gt;you can't buy a SOA&lt;/STRONG&gt;&lt;/SPAN&gt;. Indeed, SOA is something you do, and an &lt;SPAN style="TEXT-DECORATION: underline"&gt;&lt;STRONG&gt;ESB is not an architecture&lt;/STRONG&gt;&lt;/SPAN&gt;, it's a mere instance of technology.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Somehow this idea - that you cannot "buy" an SOA - is remarkable.&amp;nbsp; Somehow when people say, "you should only build and deploy what the business needs, you should take a practical approach that aligns IT and business value", that is news.&amp;nbsp; Odd because &lt;A class="" href="http://www.microsoft.com/biztalk/solutions/soa/whitepaper.mspx" mce_href="http://www.microsoft.com/biztalk/solutions/soa/whitepaper.mspx"&gt;this is what Microsoft has been saying for some time now&lt;/A&gt;.&amp;nbsp;&amp;nbsp; When common sense becomes notable, you know things are goofy.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Apparently, Bobby Wolfe's article caused quite a stir at IBM because now it carries a disclaimer!&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Since its publication, Bobby’s article has drawn a lot of interest, and we appreciate the discussion surrounding this article. Unfortunately, it gave some readers the impression that IBM® no longer values the ESB. Rest assured that nothing is further from the truth. ...&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;heh heh, amusing&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5234269" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Not+Really+Interop/default.aspx">Not Really Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/IBM/default.aspx">IBM</category></item></channel></rss>