<?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>Durgaprasad Gorti's WebLog</title><link>http://blogs.msdn.com/b/dgorti/</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 5.6.583.19431 (Build: 5.6.583.19431)</generator><item><title>Outlook quick steps and mouse button programming</title><link>http://blogs.msdn.com/b/dgorti/archive/2011/12/01/outlook-quick-steps-and-mouse-button-programming.aspx</link><pubDate>Thu, 01 Dec 2011 08:08:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10243230</guid><dc:creator>Durgaprasad Gorti</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=10243230</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2011/12/01/outlook-quick-steps-and-mouse-button-programming.aspx#comments</comments><description>&lt;p&gt;I have acciddentally discovered a cool tip.&lt;/p&gt;
&lt;p&gt;Most of you use the Outlook Quick Steps correct? Now, one of the ways you can customize is&amp;nbsp;to create your own Quick Steps&lt;/p&gt;
&lt;p&gt;For example, I have a quick step to move my mail to a folder. Then I assigned a keyboard short cut. Unfortunately the &lt;br /&gt;keyboard shortcuts are CTRL+SHIFT+1 through 12 and I have to pick one of those. The problem is that &lt;br /&gt;that key sequence CTRL + SHIFT + 2 is a difficult combination to type.&lt;/p&gt;
&lt;p&gt;While I was playing with the Microsoft Mouse, I discoverd that the middle button can have programmating specific settings.&lt;/p&gt;
&lt;p&gt;Now when you select that, you can actually assign a macro to that button. By choosing the macro there will be an&lt;br /&gt;editor that popsup and you enter your key strokes,delays, and otehr stuff there. Bingo!&lt;/p&gt;
&lt;p&gt;Now, when I am in outlook, just click the middle mouse button, which sends CTRL+SHIFT+2 and the &lt;br /&gt;mail moves to a folder.&lt;/p&gt;
&lt;p&gt;Hope some one finds this useful :-)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243230" width="1" height="1"&gt;</description></item><item><title>"Start In" folder is not honored when you launch the command prompt as an administrator</title><link>http://blogs.msdn.com/b/dgorti/archive/2010/05/10/start-in-folder-is-not-honored-when-you-launch-the-command-prompt-as-an-administrator.aspx</link><pubDate>Tue, 11 May 2010 01:55:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10010664</guid><dc:creator>dgorti</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=10010664</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2010/05/10/start-in-folder-is-not-honored-when-you-launch-the-command-prompt-as-an-administrator.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_thumb.png" width="177" height="244"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_thumb_1.png" width="244" height="182"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/StartInfolderisnothonoredwhenyoulaunchth_10A0C/image_thumb_2.png" width="244" height="123"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Say you have a command prompt shortcut. You set it to start in a particular folder by editing the properties &lt;br&gt;as shown above. Then you also set the Advanced properties to launch it as Administrator. &lt;br&gt;&lt;br&gt;You launch the shortcut and it puts you in windows\System32. Basically blows away the config you did and decides &lt;br&gt;to put you in the system32 folder. Countless times, I find myself irritated by this behavior. I launch the prompt, &lt;br&gt;i type in a command like Dir, and it goes on and on listing the system32 contents. I have to change &lt;br&gt;back to the folder I want to proceed with any work that I wanted to. &lt;/p&gt; &lt;p&gt;My good friends&amp;nbsp; tell me that this is a "security" feature. But this is annoying to me.&lt;br&gt;&lt;br&gt;In any case, the simple fix is to add &lt;strong&gt;&lt;font size="4"&gt;C:\Windows\System32\cmd.exe /k cd /d c:\users\public&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;By adding the configuration of the "Start in" folder a second time, the command prompt would behave the way you want to behave. &lt;/p&gt; &lt;p&gt;Not a great tip, I agree, but it annoyed me enough that I wanted to post a note.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10010664" width="1" height="1"&gt;</description></item><item><title>Embed Ruby code directly inside MSBUILD file using DLR and IronRuby</title><link>http://blogs.msdn.com/b/dgorti/archive/2009/09/11/embed-ruby-code-directly-inside-msbuild-file-using-dlr-and-ironruby.aspx</link><pubDate>Fri, 11 Sep 2009 09:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894044</guid><dc:creator>dgorti</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=9894044</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2009/09/11/embed-ruby-code-directly-inside-msbuild-file-using-dlr-and-ironruby.aspx#comments</comments><description>&lt;P&gt;You know the MSBUILD drill. Everything is a custom task. Need to add two numbers? Write a custom task.&lt;BR&gt;Need to replace spaces in a string with '_' character? Write a custom task. I don't like the overhead of &lt;BR&gt;writing custom tasks. &lt;/P&gt;
&lt;P&gt;What you have with MSBuild is bascially an XML file and good amount of "build logic". Anything that you &lt;BR&gt;could have done with even a simple batch script has to be in a custom task.&amp;nbsp; I don't like to have&lt;BR&gt;some code in the MSBUILD script and some other code in a custom task tucked in somewhere else. &lt;BR&gt;I want to be able to embed a simple script in the MSBuild file. I searched for it and I could not find a way.&lt;/P&gt;
&lt;P&gt;I have to to roll my own way? Well thats what I did. &lt;BR&gt;I found that I could actually embedding IronRuby in MSBuild file. &lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Project&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;DefaultTargets&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ExecuteTest&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;xmlns&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;UsingTask&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;TaskName&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;MSBuildTasks.RubyHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;" &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;AssemblyFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;MSBuild_Ruby.dll&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;PropertyGroup&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp; &lt;FONT size=2&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;RubyScript&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&amp;lt;![CDATA[&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&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; File.open("MyTestFile.txt", "w") do |file|&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.times do |i|&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file.write "This is line #{i}\n"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;end&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "success"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;]]&amp;gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;RubyScript&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;PropertyGroup&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Target&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ExecuteTest&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;RubyHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;ScriptSource&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;$(RubyScript)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Output&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;TaskParameter&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ReturnValue&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;PropertyName&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ReturnValue&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;RubyHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Message&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&lt;FONT color=#ff0000 size=2&gt;Text&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;$(ReturnValue)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Target&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;Project&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;With this,&amp;nbsp;you can see that the ruby code is embedded&amp;nbsp;within the MSBUILD file itself, and no need to maintain &lt;BR&gt;separate set of tasks. NO MORE a task for adding, deleting, and multiplying numbers!!.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Of course you need 1 custom task that hosts the ruby engine and runs the ruby code for you.&amp;nbsp;&amp;nbsp;&lt;BR&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here is the source code for the custom task &lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; System;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; System.Collections.Generic;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; System.Text;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Microsoft.Scripting.Hosting;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; IronRuby.Runtime;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; IronRuby;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Microsoft.Build.Framework;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;namespace&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; MSBuildTasks&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;RubyHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ITask&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;{ &lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IBuildEngine&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; engine; &lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IBuildEngine&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; BuildEngine&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; engine; }&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { engine = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;; }&lt;/P&gt;
&lt;P&gt;} &lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ITaskHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; host;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ITaskHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; HostObject&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; host; }&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { host = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; scriptSource;&lt;/P&gt;
&lt;P&gt;[&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Required&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;]&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ScriptSource&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; scriptSource; }&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { scriptSource = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; returnValue;&lt;/P&gt;
&lt;P&gt;[&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Output&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;]&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ReturnValue&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; returnValue; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; LogMessage(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; message, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageImportance&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; imp)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BuildMessageEventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; args = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BuildMessageEventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/P&gt;
&lt;P&gt;message, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"RubyIntegration.RunRake"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageImportance&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Normal);&lt;/P&gt;
&lt;P&gt;engine.LogMessageEvent(args);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Execute()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;try&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; runtime = IronRuby.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Ruby&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CreateRuntime();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ScriptEngine&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Ruby_Engine = runtime.GetEngine(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Ruby"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ScriptSource&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; src = Ruby_Engine.CreateScriptSourceFromString(scriptSource, Microsoft.Scripting.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SourceCodeKind&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Statements);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; result = src.Execute();&lt;/P&gt;
&lt;P&gt;returnValue = result.ToString();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;catch&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Exception&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ex)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;LogMessage(ex.ToString(), &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageImportance&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.High);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;I know that the code is quick and dirty and can be improved on this. &lt;BR&gt;I hope to enhance it soon. But I can't contain my joy and wanted to &lt;BR&gt;spread the love.... &lt;/P&gt;
&lt;P&gt;Let me know if you liked this idea and share any further thoughts&lt;/P&gt;&lt;/FONT&gt;&lt;/CODE&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894044" width="1" height="1"&gt;</description></item><item><title>Ruby On Rails with IIS 7 - Reloaded</title><link>http://blogs.msdn.com/b/dgorti/archive/2009/06/17/ruby-on-rails-with-iis-7-reloaded.aspx</link><pubDate>Thu, 18 Jun 2009 01:15:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9770763</guid><dc:creator>dgorti</dc:creator><slash:comments>26</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=9770763</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2009/06/17/ruby-on-rails-with-iis-7-reloaded.aspx#comments</comments><description>&lt;p&gt;In my last post I mentioned getting into Ruby and making MABUILD and rake work together. &lt;br&gt;I think I found a better way to do the same with PowerShell integration, which I will &lt;br&gt;write up sometime this week.&lt;/p&gt; &lt;p&gt;Now, it is inevitable that Ruby leads to Ruby On Rails. I needed to get RoR work on my dev machine with VISTA SP1 and IIS7.&lt;br&gt;I was little surprised to find that there are very few articles on this. A few I found were outdated. Then I landed on Ruslan's &lt;a href="http://ruslany.net/2008/08/ruby-on-rails-in-iis-70-with-url-rewriter/"&gt;post&lt;/a&gt;. &lt;br&gt;It got me to a point but then I was stuck. So I walked to Ruslan's office and we discussed this quite a bit. I went back to my office and researched this some more.&lt;br&gt;I finally got this working after about 3 days of stumbling around. So here is the post that builds on Ruslan's &lt;br&gt;post and clarifies a few things. Mostly I wanted to make sure that even folks like me, who are beginners in the Ruby universe, &lt;br&gt;could follow the steps to get RoR and IIS 7 working.&lt;/p&gt; &lt;p&gt;I am starting here with a clean system with VISTA SP1. &lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&amp;nbsp; INSTAL IIS AND CGI&lt;/u&gt;&lt;br&gt;&lt;/p&gt; &lt;p&gt;Go to control panel, Programs and Features and then select "Turn features on or off". You can get there quicker&lt;br&gt;by typing appwiz.cpl on a command prompt and then selecting "Turn features on or off " from the left side&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb.png" width="199" height="175"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;From the features select World Wide Web Services&lt;br&gt;and make sure that you select the following &lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;font color="#008000"&gt;&lt;strong&gt;REQUIRED: CGI. This is the same as the FastCGI support&lt;/strong&gt;&lt;/font&gt;  &lt;li&gt;&lt;strong&gt;&lt;font color="#008000"&gt;REQUIRED: IIS Management Console&lt;/font&gt;&lt;/strong&gt;  &lt;li&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;OPTIONAL: Custom HTTP Features: Static Content, etc&lt;br&gt;[We will use this to check if IIS is installed correctly]&lt;/font&gt;&lt;/strong&gt;  &lt;li&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;OPTIONAL : Other health and diagnostics info as &lt;br&gt;Shows in the picture below&lt;/font&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_3.png" width="321" height="485"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click OK and let the Windows install IIS and FastCGI for you.&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&amp;nbsp; VERIFY THAT IIS IS WORKING&lt;/u&gt;&lt;/p&gt; &lt;p&gt;Once installed you can verify that the IIS is installed by going to the &lt;br&gt;&lt;a href="http://localhost/iisstart.htm"&gt;http://localhost/iisstart.htm&lt;/a&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_4.png" width="244" height="163"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Please note: If you did not enable STATIC CONTENT feature when you installed, you will get a 404 NOT FOUND. &lt;br&gt;You see the file right there but you still get 404 NOT FOUND. Security aside, it would be great &lt;br&gt;if there is a more easier way to diagnose this, I ended up researching this for more than 3 hours wondering&lt;br&gt;why am I getting the 404 not found. Anyway, now you know and you don't need to waste those hours. &lt;br&gt;Again, enable the static content feature to be able to see this static content page. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 3: INSTALL RUBY&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;Navigate to &lt;a title="Ruby 1.8.6 One-Click Installer" href="http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe"&gt;Ruby 1.8.6 One-Click Installer&lt;/a&gt; and install RUBY&lt;br&gt;&lt;font color="#ff0000"&gt;CAUTION: DONT INSTALL TO A FOLDER that has SPACES in the name or its path.&amp;nbsp; like "C:\program Files\Ruby"&lt;br&gt;I had strange errors and I had to reinstall RUBY. It is best to stick with the C:\Ruby.&lt;/font&gt; &lt;br&gt;As a side and tangential note, what's up with installing to C:\Ruby? Aren't the people in that &lt;br&gt;alternate universe hate installing to root directories like C:\? Why can't it default to C:\Program Files\Ruby?&lt;br&gt;RUBY is supposed to make you HAPPY!! Huh!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 4: VERIFY RUBY IS IN THE PATH&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;RUBY Installation should have added the C:\ruby\bin [or whatever the path you gave] to the path. &lt;br&gt;Open a command prompt; type "SET PATH" and look at the path. You should see the ruby\bin in the path.&lt;br&gt;If not, no big deal, add ruby to the path in the System Variables. &lt;br&gt;Type ruby -help to see that you get some help on the screen. This verifies that Ruby is indeed installed. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 5: INSTALL RAILS&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;on a command prompt, type "Gem Install Rails". [The dependencies are already &lt;br&gt;included, contrary to popular belief that suggests the -includedependencies option&lt;br&gt;is required to do so]&lt;br&gt;Once installed, do "gem list" to list the gems locally installed. You should see &lt;br&gt;something like this - which should include rails. &lt;/p&gt; &lt;p&gt;C:\Windows\system32&amp;gt;gem list  &lt;p&gt;*** LOCAL GEMS ***  &lt;p&gt;actionmailer (2.3.2)&lt;br&gt;actionpack (2.3.2)&lt;br&gt;activerecord (2.3.2)&lt;br&gt;activeresource (2.3.2)&lt;br&gt;activesupport (2.3.2)&lt;br&gt;fxri (0.3.6)&lt;br&gt;fxruby (1.6.16)&lt;br&gt;hpricot (0.6.164)&lt;br&gt;log4r (1.0.5)&lt;br&gt;ptools (1.1.6)&lt;br&gt;&lt;strong&gt;&lt;font color="#008000" size="4"&gt;rails (2.3.2)&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;rake (0.8.7, 0.8.1)&lt;br&gt;ruby-opengl (0.60.0)&lt;br&gt;test-unit (2.0.1)&lt;br&gt;win32-api (1.2.1, 1.2.0)&lt;br&gt;win32-clipboard (0.4.4)&lt;br&gt;win32-dir (0.3.2)&lt;br&gt;win32-eventlog (0.5.0)&lt;br&gt;win32-file (0.5.5)&lt;br&gt;win32-file-stat (1.3.1)&lt;br&gt;win32-process (0.5.9)&lt;br&gt;win32-sapi (0.1.4)&lt;br&gt;win32-sound (0.4.1)&lt;br&gt;windows-api (0.2.4)&lt;br&gt;windows-pr (0.9.3) &lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 6: Install FASTCGI Update for IIS7&lt;br&gt;&lt;a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=19600729-8470-4956-a276-200450d814bd&amp;amp;displaylang=en&amp;amp;Hash=CUX9vrzjILBL3AghMTxtsgswXdorhJT4JhGOGHeRvFL9AQlhlkUkNtnVcQflyQD7VwtQyh51gAxTnsa4f4OlBA%3d%3d" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=19600729-8470-4956-a276-200450d814bd&amp;amp;displaylang=en&amp;amp;Hash=CUX9vrzjILBL3AghMTxtsgswXdorhJT4JhGOGHeRvFL9AQlhlkUkNtnVcQflyQD7VwtQyh51gAxTnsa4f4OlBA%3d%3d"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=19600729-8470-4956-a276-200450d814bd&amp;amp;displaylang=en&amp;amp;Hash=CUX9vrzjILBL3AghMTxtsgswXdorhJT4JhGOGHeRvFL9AQlhlkUkNtnVcQflyQD7VwtQyh51gAxTnsa4f4OlBA%3d%3d&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff" size="3"&gt;I am not quite sure if this is a general update for FastCGI or just for PHP. To avoid hitting my head against a wall, I installed this anyway.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;br&gt;&lt;u&gt;&lt;strong&gt;Step 7: Pretend that you are hosting a website called&amp;nbsp; RoRIIS7 &lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;Add a HOST Entry so that the name resolver won't go out to the DNS Server. &lt;br&gt;&lt;font color="#ff0000" size="3"&gt;Don't forget to use an administrative command prompt from which you &lt;br&gt;&lt;/font&gt;&lt;font color="#ff0000" size="3"&gt;launch notepad. edit Windows\System32\Driver\Etc\Hosts like below. &lt;/font&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_20.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_8.png" width="472" height="267"&gt;&lt;/a&gt;  &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 8&amp;nbsp; Add a new Website to IIS&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Go to C:\InetPub [or where ever you installed the inetpub to]&lt;/p&gt; &lt;p&gt;create a directory called RoRIIS7. We are not touching the wwwroot directory for this experiment.&lt;br&gt;i will post an update dealing with default web site later. &lt;br&gt;&lt;/p&gt; &lt;p&gt;Open MMC, Add the Internet Services Manager to the MMC Console.&lt;br&gt;Expand the IIS Manager. It will show the local web server. &lt;br&gt;Click on Add WebSite to add a website like below&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_2.png" width="378" height="260"&gt;&lt;/a&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;Here we are adding a new WebSite RoRIIS7&lt;br&gt;mapped to the physical directory C:\Inetpub\RoRIIS7 &lt;br&gt;Please note that the HostName we are using&lt;strong&gt;&lt;font color="#0000ff" size="3"&gt; &lt;/font&gt;&lt;/strong&gt;&lt;font color="#0000ff" size="3"&gt;&lt;strong&gt;RoRIIS7&lt;/strong&gt;&lt;/font&gt;&lt;br&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;AND that I am using port 8080&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_18.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_7.png" width="408" height="398"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The website should start.&lt;/p&gt;&lt;/blockquote&gt; &lt;div&gt;&lt;strong&gt;&lt;u&gt;Step 9 Verify that the new website is working&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt; &lt;blockquote&gt; &lt;div&gt;To verify that the website is working, copy the IISSTART.HTM and the &lt;br&gt;welcome.png files into the RoRIIS7 directory. &lt;br&gt;Then navigate to &lt;a href="http://RoRIIS7/iisstart.htm"&gt;http://RoRIIS7/iisstart.htm&lt;/a&gt;&lt;br&gt;You should see a page similar to step 2. &lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt; &lt;div&gt;&lt;strong&gt;&lt;u&gt;Step 10 Generate a RAILS APP&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt; &lt;blockquote&gt; &lt;div&gt;NOTE: When you generate the Rails app, make sure that &lt;br&gt;you use -D option. -D option generated the dispatchers&lt;br&gt;for CGI and FastCGI&lt;/div&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;&lt;font color="#0000ff"&gt;Luanch CMD prompt as administrator&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;&lt;font color="#0000ff"&gt;cd C:\inetpub\RoRIIS7&lt;br&gt;&lt;strong&gt;&lt;font size="4"&gt;rails -D MyApp&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;cd MyApp&lt;br&gt;ruby script\generate Controller Test Index&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 11 Generate a RAILS APP&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Modify the app\controllers\test_controller.rb like below&lt;br&gt;This will enable it to display some test when we navigate to this URL&lt;/p&gt; &lt;p&gt;class TestController &amp;lt; ApplicationController&lt;br&gt;&amp;nbsp;&amp;nbsp; def index&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; render :text=&amp;gt;"The index action"&lt;br&gt;&amp;nbsp;&amp;nbsp; end&lt;br&gt;&amp;nbsp;&amp;nbsp; def about&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; render :text=&amp;gt;"The about action"&lt;br&gt;&amp;nbsp;&amp;nbsp; end&lt;br&gt;end&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 12 Hook up IIS to Ruby&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;So far, we have IIS Setup and a Ruby App Setup&lt;br&gt;We need to hook them together now. &lt;br&gt;&lt;/p&gt; &lt;p&gt;Go to the MMC/Internet Services Manager, Go to the site RoRIIS7 in the &lt;br&gt;MMC snapin. We are now going to add a module mapping&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_22.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_9.png" width="373" height="324"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;We are mapping * ==&amp;gt; All requests To the FastCGI Module. &lt;br&gt;The executable we use is of course the ruby interpreter. &lt;br&gt;But then there you see a PIPE character and the path to the &lt;br&gt;dispatch.fcgi. The reason is that Ruby by iteself does not handle&lt;br&gt;the FCGI. The FCGI handling is provided by the Rails &lt;br&gt;Dispatcher. &lt;/p&gt; &lt;p&gt;Once you add the mapping go to &lt;br&gt;C:\windows\system32\inetsrv\config and open &lt;br&gt;applicationhost.config&lt;br&gt;In this config file you should see a section for fast cgi&lt;/p&gt; &lt;p&gt;&amp;lt;fastCgi&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;application fullPath="C:\ruby\bin\ruby.exe" arguments="C:\inetpub\RoRIIS7\MyApp\public\dispatch.fcgi" /&amp;gt;&lt;br&gt;&amp;lt;/fastCgi&amp;gt; &lt;p&gt; and another section for&lt;br&gt;the module mapping. &lt;/p&gt; &lt;p&gt;&amp;lt;/system.webServer&amp;gt;&lt;br&gt;&amp;lt;location path="RoRIIS7"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.webServer&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;handlers&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="RubyFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\ruby\bin\ruby.exe|C:\inetpub\RoRIIS7\MyApp\public\dispatch.fcgi" resourceType="Unspecified" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/handlers&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.webServer&amp;gt; &lt;p&gt;&lt;br&gt;These sections are created for you when you added the module mapping &lt;br&gt;through the GUI above. Now, you could directly edit the file yourself if you wanted to. &lt;br&gt;&lt;br&gt;Sensing the smell of completion you go to &lt;a href="http://roriis7/test/about"&gt;http://roriis7/test/about&lt;/a&gt; &lt;br&gt;but then you are greeted by the&lt;br&gt; &lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_24.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_10.png" width="420" height="316"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 13 Fixing Permissions&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt; When working with IIS, I always turn on the security audit.&lt;br&gt;Turning the security audit on can it self be somewhat of a challenge. &lt;br&gt;Without going into detail, what is required apparently is to &lt;br&gt;grant NETWORK Service Account permissions to the RoRIIS7 Folder. &lt;br&gt;Since Ruby will write some logfiles etc to that dir. You could&lt;br&gt;possibly fine tune this later if you needed to. &lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_26.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_11.png" width="286" height="348"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Do an IISRESET and go visit &lt;a href="http://roriis7:8080/test/about"&gt;http://roriis7:8080/test/about&lt;/a&gt;&lt;br&gt;OOPS! What went wrong now?&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_28.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_12.png" width="685" height="254"&gt;&lt;/a&gt; &lt;br&gt;Apparently the RAILS needs SQLITE and it is not happy that it can't find SQLLite&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 14 Installing SQLITE and the SQLLITE GEM&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Download SQLITE-3.6.15 ZIP file and place the exe in the Ruby\Bin directory&lt;br&gt;this is the command line config&amp;nbsp; tool&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;Download SQLITEDLL-3.6.15 ZIP and place the dll in the system32 directory.&lt;br&gt;This is the engine for SQLITE. &lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;Now we need to install the GEM&lt;/p&gt; &lt;p&gt;&lt;a title="http://blog.anlek.com/2008/09/installing-updating-sqlite3-on-windows/" href="http://blog.anlek.com/2008/09/installing-updating-sqlite3-on-windows/"&gt;http://blog.anlek.com/2008/09/installing-updating-sqlite3-on-windows/&lt;/a&gt; has the &lt;br&gt;tip on getting this done&lt;br&gt;&lt;br&gt;&lt;strong&gt;&lt;code&gt;gem install --version 1.2.3 sqlite3-ruby&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 14 COMPLETE!!!&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Now you navigate to &lt;a href="http://roriis7:8080/test/about"&gt;http://roriis7:8080/test/about&lt;/a&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;and you should see&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_30.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/RubyOnRailswithIIS7Reloaded_14757/image_thumb_13.png" width="791" height="279"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;There you go ladies and gentlemen, I give you Ruby On Rails with IIS7&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9770763" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/dgorti/archive/tags/Ruby+On+Rails+IIS+IIS+7+RoR+Windows/">Ruby On Rails IIS IIS 7 RoR Windows</category></item><item><title>Calling RAKE from MSBUILD</title><link>http://blogs.msdn.com/b/dgorti/archive/2009/06/07/calling-rake-from-msbuild.aspx</link><pubDate>Mon, 08 Jun 2009 02:08:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9705134</guid><dc:creator>dgorti</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=9705134</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2009/06/07/calling-rake-from-msbuild.aspx#comments</comments><description>&lt;p&gt;These days, I am spending quite a bit of time with Ruby,&amp;nbsp; Ruby On Rails and RAKE. I am not into the Ruby religion yet,&lt;br&gt;and not drinking the ruby Kool-aid that much. Just a little. &lt;/p&gt; &lt;p&gt;I needed to integrate the TeamBuild (Team System) with Ruby/RAKE.&amp;nbsp; So in other words, I needed to &lt;br&gt; call RAKE from MSBUILD. It turned out to be slightly harder than I expected. I am new to MSBUILD, Ruby and RAKE, &lt;br&gt;so I had to figure out quite a few of things.&lt;/p&gt; &lt;p&gt;I ended up writing a custom task. From the custom task, I called Rake and captured the output. &lt;br&gt;Definitely not rocket science, but getting everything working properly is not easy either. &lt;/p&gt; &lt;p&gt;So here it is. &lt;/p&gt; &lt;p&gt;First the custom task. &lt;/p&gt; &lt;p&gt;Here is the entire code file&lt;/p&gt; &lt;p&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Linq;&lt;br&gt;using System.Text;&lt;br&gt;using Microsoft.Build.Framework;&lt;br&gt;using System.Diagnostics;&lt;br&gt;using System.IO;&lt;br&gt;namespace RubyIntegration&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class RunRake : ITask&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private IBuildEngine engine;&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;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public IBuildEngine BuildEngine&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return engine; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { engine = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private ITaskHost host;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ITaskHost HostObject&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return host; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { host = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string RakeFileDir;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string RakeFileDirectory&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return RakeFileDir; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { RakeFileDir = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string RubyInstallDir;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string RubyInstallDirectory&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return RubyInstallDir; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { RubyInstallDir = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string RakeTargetName;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string RakeTarget&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return RakeTargetName; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { RakeTargetName = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string strOutput;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Output]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string RakeOutput&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return strOutput; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { strOutput = value; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void LogMessage(string message, MessageImportance imp)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuildMessageEventArgs args = new BuildMessageEventArgs(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message, string.Empty, "RubyIntegration.RunRake", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine.LogMessageEvent(args);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool Execute()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool result = false;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("***** MSBUILD&amp;nbsp; &amp;lt;--&amp;gt; RAKE ********", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Preparing to invoke Rake", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("*** INPUTS", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Ruby Install Directory " + RubyInstallDir, MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Rake File Directory " + RakeFileDirectory, MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("RakeTargetName " + RakeTargetName, MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("***", MessageImportance.Normal);  &lt;p&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; LogMessage("*** CHEKING PARAMETERS", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Directory.Exists(RubyInstallDir)){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Ruby Install Directory " + RubyInstallDir + " exists.", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Ruby Install Directory " + RubyInstallDir + " does not exist - exiting task.", MessageImportance.High);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string RubyPath = Path.Combine(RubyInstallDir, "ruby.exe");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (File.Exists(RubyPath))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Ruby.exe is found at " + RubyPath, MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("Ruby.exe is not found at path" + RubyPath + " . - exiting task.", MessageImportance.High);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string RakePath = Path.Combine(RubyInstallDir, "rake");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (File.Exists(RakePath))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("rake file (rake ruby code) is found at " + RakePath, MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage("rake file (rake ruby code) is is not found at path" + RakePath + ". - exiting task.", MessageImportance.High);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&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; LogMessage("***", MessageImportance.Normal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessStartInfo info = new ProcessStartInfo();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.RedirectStandardOutput = true;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.UseShellExecute = false;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.FileName = RubyPath;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.Arguments = RakePath + " "&amp;nbsp; + RakeTargetName;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.WorkingDirectory = RakeFileDirectory;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Process p = Process.Start(info);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strOutput = p.StandardOutput.ReadToEnd();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p.WaitForExit();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = true;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LogMessage(ex.ToString(), MessageImportance.High);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}  &lt;p&gt;&amp;nbsp; &lt;p&gt;Here is the MSBUILD FILE  &lt;p&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br&gt;&amp;lt;Project xmlns="&lt;a href="http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;"&gt;http://schemas.microsoft.com/developer/msbuild/2003"&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;UsingTask AssemblyFile="RunRake.dll" TaskName="RubyIntegration.RunRake" /&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;Target Name="default" &amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RunRake&amp;nbsp;&amp;nbsp;&amp;nbsp; RubyInstallDirectory ="C:\ruby\bin"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RakeFileDirectory="$(MSbuildProjectDirectory)\ruby\edgeserver" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RakeTarget="alcoholic:getSmashed"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Output TaskParameter="RakeOutput" PropertyName="RakeOutput"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RunRake&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Message Text="The output from Rake is... $(RakeOutput)" /&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/Target&amp;gt;&lt;br&gt;&amp;lt;/Project&amp;gt;&lt;br&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;NOTES&lt;/strong&gt;&lt;/font&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Fist I attempted to creating a RAKE process by trying to call rake.&amp;nbsp; (pass rake as the file name to the process start info).&lt;br&gt;The process failed to start saying that the file not found.&lt;br&gt;Then I tried with rake.bat &lt;/font&gt;(pass rake.bat as the file name to the process start info).&lt;br&gt;&lt;font color="#0000ff"&gt;The problem seems to be that RAKE.BAT does some &lt;br&gt;manipulation and calls ruby.exe and passes the file "rake" to ruby.exe.&amp;nbsp; Normally it would end up something like&lt;br&gt;[ruby.exe c:\ruby\bin\rake ..].&lt;br&gt;However The path to rake is getting resolved incorrectly when I pass the rake.bat as the &lt;br&gt;program name.&amp;nbsp; It is using the working directory and ending up with &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;[ruby.exe &amp;lt;MY WORKING DIR&amp;gt;\rake...]&lt;br&gt;Obviously there is no file called "rake"&amp;nbsp; in my working directory. &lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;I need to resolve this, but for now this should get me going. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;The installation for for Ruby could be possibly obtained by resolving &lt;br&gt;the file extension .rb to an executable. That is another task that can be added &lt;br&gt;to eliminate the need to send the ruby install directory as a parameter. &lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9705134" width="1" height="1"&gt;</description></item><item><title>Doing the same thing again and again</title><link>http://blogs.msdn.com/b/dgorti/archive/2009/06/04/doing-the-same-thing-again-and-again.aspx</link><pubDate>Thu, 04 Jun 2009 08:39:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9698393</guid><dc:creator>dgorti</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=9698393</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2009/06/04/doing-the-same-thing-again-and-again.aspx#comments</comments><description>&lt;p&gt;A while back in the C++ days, there were class libraries doing things like &lt;br&gt;sending mail, opening/reading cert store, event log writing reading, etc. These were written in C++ to encapsulate some of the pain associated with &lt;br&gt;routine tasks. Great Idea!!&lt;/p&gt; &lt;p&gt;MFC's CReg CSocket and a bumch of classes started with C made things easier. If you need to do stuff &lt;br&gt;you would use one of those reusable libraries or you would write one of those reusable classes. &lt;/p&gt; &lt;p&gt;Then came COM. Once again there are COM components that did read/write registry, read/write to event log.&lt;br&gt;you can see the ATL's incarnation of Registry classes as an example. &lt;/p&gt; &lt;p&gt;Then came ASP/VbScript. You need to read write the file system and registry from ASP files. Enter the Scripting.FileSystemObject&lt;br&gt;and its cousins. Due the popularity of ASP and web development, great amount of functionality needed to be cast through &lt;br&gt;IDispatch interfaces to make it available for VBScript programmers. &lt;/p&gt; &lt;p&gt;&lt;br&gt;Human beings want to make progress. So .NET arrived. So there are new way to read&amp;nbsp; / write registry&lt;br&gt;and read write event log and read write files. OK&lt;/p&gt; &lt;p&gt;What about powershell? The world then needs to be packaged in Cmdlets to be consumed from the &lt;br&gt;powershell. great. &lt;/p&gt; &lt;p&gt;&lt;br&gt;Well how about MSBuild? How can I read write registry from MSBUILD? Of course you need to &lt;br&gt;have the MSBuild tasks. Custom or not custom, you need to view the world through the MSBUILD Tasks. &lt;br&gt;There are community libraries that help you read registry and do great things like send mail, etc. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;I wonder. How many ways do we need to read/write the registry?&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9698393" width="1" height="1"&gt;</description></item><item><title>To Agile or Not Agile</title><link>http://blogs.msdn.com/b/dgorti/archive/2009/01/23/to-agile-or-not-agile.aspx</link><pubDate>Fri, 23 Jan 2009 10:33:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9372294</guid><dc:creator>dgorti</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=9372294</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2009/01/23/to-agile-or-not-agile.aspx#comments</comments><description>&lt;p&gt;&lt;font face="consol" color="#800080" size="2"&gt;I have been pondering over the Agile, Iterative, XTreme, waterfall and several other software methodologies. I think that each of them have their strengths, I have no reason to bash one methodology or pump some other methodology.&lt;br&gt;Personally, I really don't care about the methodology. I don't think it matters. Let me explain.&lt;br&gt;&lt;br&gt;Since I started working about 20 years back, I always wanted to be organized and accomplish more. In one training class, 20 years back, the instructor said&lt;br&gt;"I know of no better idea than to just write down your tasks and prioritize". I heard it, I nodded. Since then, I have been trying to follow that simple principle.&lt;br&gt;I start using Outlook tasks and not really update them or use them as guidance. Before outlook, I used to purchase day planners from a reputed company&lt;br&gt;and I eventually left 95% of the days unfilled or unused. Then I bought a palm pilot. Then upgraded the memory. Then decided to switch to the paper based planners.&lt;br&gt;You get the idea. I am still looking for&amp;nbsp; a methodology.&lt;br&gt;&lt;br&gt;The point is that the methodology, or the means, is not the problem. "I" am the problem. If "I" decide to be more disciplined, a mere post it note would have &lt;br&gt;served the purpose. Well may be a $2 note book. The problem is that I imagine the most complex of situations, and imagine my self following the &lt;br&gt;discipline to the core and create all sorts of scenarios where I need to have more elaborate mechanisms to keep me disciplined. Some where along the line, &lt;br&gt;my focus goes form "I" to the "methodology" and one more year passes before I get really disciplined. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#800080" size="2"&gt;There is NOTHING wrong with the waterfall methodology. I am sure that if we send a bi-partisan committee they will find projects where waterfall is just worked fine. &lt;br&gt;There is NOTHING wrong with agile either. There are projects where it succeeds and there are projects where it fails.&lt;br&gt;&lt;br&gt;But I BET that in both cases, the projects that succeeded would have succeeded with either methodology, and that they would have succeeded not because of &lt;br&gt;the methodology, but because of the fundamental discipline of how they conducted the business.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#800080" size="2"&gt;When it comes to software "engineering", there are some fundamental principles. Like Mr.Covey says in his "Principle Centered Leadership", there are some &lt;br&gt;fundamental principles when it comes to software engineering&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;font color="#800080" size="2"&gt;Have your requirements&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Have an idea of what you are building&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Develop the fundamental architecture of the components&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Have a release plan &lt;/font&gt; &lt;li&gt;&lt;font color="#800080" size="2"&gt;Write &lt;strong&gt;&lt;u&gt;very detailed&lt;/u&gt;&lt;/strong&gt; specs and design documents (sorry agile folks!). Spend time in making sure &lt;br&gt;that the design is solid. The code should be a mechanical reproduction of the design (as much as possible.not taking a religion here)&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Don't pretend Quality is #1, behave so. Role model Quality as fundametal principle&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Take time to test - functional, API, Perf, Stress&lt;/font&gt;  &lt;li&gt;&lt;font color="#800080" size="2"&gt;Fix bugs. Don't let service packs be the bug fix vehicles.&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;font color="#800080" size="2"&gt;Fundamental, natural principles don't change. It is our never ending quest to invent schemes that lead us to believe that we can defy them - that blinds &lt;br&gt;us.&lt;br&gt;&lt;br&gt;Let me tell you about losing weight. Atkins, South Beach, Nutri System? Or Eat Sensible and Exercise?&lt;br&gt;Let me go buy the South Beach Diet book. The girls on the cover page look &lt;strong&gt;beautiful.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="consol" color="#800080" size="2"&gt;Comments?&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="consol" color="#800080" size="2"&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9372294" width="1" height="1"&gt;</description></item><item><title>VSTT Controller and Agent setup</title><link>http://blogs.msdn.com/b/dgorti/archive/2007/10/02/vstt-controller-and-agent-setup.aspx</link><pubDate>Wed, 03 Oct 2007 06:18:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5252161</guid><dc:creator>dgorti</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=5252161</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2007/10/02/vstt-controller-and-agent-setup.aspx#comments</comments><description>&lt;p&gt;In my previous blog article, I pointed out that in a workgroup environment, Windows XP has the force guest policy on and it prevents agents and clients connecting to the controller.    &lt;br /&gt;    &lt;br /&gt;In this post, I want to expand on this and talk a bit more about VSTT controller and agent setup. Particularly, I will talk about the user account requirements on the machines running controller, agent and the client.     &lt;br /&gt;    &lt;br /&gt;Ed Glas already talked about the setup in general at &lt;a href="http://blogs.msdn.com/edglas/pages/load-agent-and-load-controller-installation-and-configuration-guide.aspx"&gt;http://blogs.msdn.com/edglas/pages/load-agent-and-load-controller-installation-and-configuration-guide.aspx&lt;/a&gt;, where he has a list of user account and password requirements on the machines running controller and agent. In this post, I want to drill down further into the reasons behind those user account requirements. I will do this by walking you through the installation process of a controller, agent and a client and troubleshooting the authentication issues. &lt;/p&gt;  &lt;p&gt;To start with, I have 3 machines. VSTTClient, VSTTController and VSTTAgent1. I have Windows XP SP2 on all the 3 machines. They are all in a workgroup TESTRIG. I have intentionally made the administrator password &lt;strong&gt;different&lt;/strong&gt; on all the 3 machines. The idea is not accidentally authenticate to another box as an Admin. Other than this, all the machines are clean and no other setup has been done. &lt;/p&gt;  &lt;p&gt;Before we proceed to the installation, I want to go over a few things. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. Workgroup authentication&lt;/strong&gt;     &lt;br /&gt;In a Windows domain environment, there is a central authority to validate credentials. In a workgroup environment, there is no such central authority. Still, we should be able to have computers in a workgroup talk to each other and authenticate users. To enable this, local accounts have a special characteristic that allows the local security authority on the computer to authenticate a &amp;quot;principal&amp;quot; in a special way.     &lt;br /&gt;If you have two computers and a principal &amp;quot;UserXYZ&amp;quot; on both machines the security identifiers are different for MACHINE1\UserXYZ and MACHINE2\UserXYZ and for all practical purposes they are two completely different &amp;quot;Principals&amp;quot;. However if the passwords are the same for them on each of these computers, the local security authority treats them as the     &lt;br /&gt;same principal.     &lt;br /&gt;    &lt;br /&gt;So when MACHINE1\UserXYZ tries to authenticate to MACHINE2\UserXYZ, and if the passwords are the same, then on MACHINE2, the UserXYZ is authenticated successfully and     &lt;br /&gt;is &lt;strong&gt;treated as MACHINE2\UserXYZ. &lt;/strong&gt;Note the last sentence. The user MACHINE1\UserXYZ     &lt;br /&gt;is authenticated as MACHINE2\UserXYZ if the passwords are the same.     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. Force Guest      &lt;br /&gt;&lt;/strong&gt;As I mentioned in the previous article, in a default Windows XP workgroup environment, the force guest policy is on by default. You can quickly check this out by mapping a share from a one machine to the other. Here, I am trying to map a share from the VSTTController to VSTTAgent1 and I am forced to login as a Guest, and the User Name box is grayed out. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/forcegueston_1.png"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="215" alt="forcegueston" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/forcegueston_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If the force guest policy is on, it does not matter if you have the same users and passwords, you can not authenticate to the machine as any other principal than the Guest. You can turn it off using Regedt32, HKLM\System\CurrentControlSet\Control\Lsa and editing the forceguest value to 0. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3. Security Audit      &lt;br /&gt;&lt;/strong&gt;If you are having authentication issues and don't know what is happening, the security audit policy is your good friend. Normally security audit is turned off and hence you will not see the events in the event viewer.     &lt;br /&gt;To turn the security auditing, open mmc, add group policy object editor, select local computer. Then Select Local Computer Policy\Computer Configuration\Windows Settings\Security settings\Local Policies\AuditPolicy and turn on Success and Failure auditing for the events of interest. For troubleshooting purposes, I turn on the audit for everything here. Granted this generates a lot of auditing but at least I know what is going on and once I am done troubleshooting, I can turn the auditing off.&amp;#xA0; &lt;br /&gt;Once done, on a command prompt, run gpupdate /force to apply the policy. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Installing the Controller and Agent        &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;Now that we have the basics covered, I started the installation process with the VSTTController box on which I intend to install the Controller. The first thing is to turn off the force guest policy since I already know that the agent and the client needs to connect and authenticate to the controller. Then I added a user CSUser. This is the user the controller service will run as. During the installation process, you need to pick a user under which the controller service runs under and I picked the CSUser.     &lt;br /&gt;    &lt;br /&gt;After the installation of the controller, I have, on the VSTTController machine,&amp;#xA0; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A user account CSUser &lt;/li&gt;    &lt;li&gt;An empty TeamTestAgentService group &lt;/li&gt;    &lt;li&gt;An empty TeamTestControllerAdmins group &lt;/li&gt;    &lt;li&gt;An empty TeamTestControllerUsers group. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;At this point the controller service seems to be running, so I am happy so far. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The next step then is to go to the VSTTAgent1 machine and install the Agent. Note that on this machine I did not yet turn the ForceGuest policy off on VSTTAgent1. The reason, once again, is that I wanted to understand the minimal stuff that I need to do get this rig working.&amp;#xA0; &lt;br /&gt;Before I started the agent installation, I added the user AgentUser to the machine. This is the identity under which the agent process will run. I logged in as &lt;strong&gt;Administrator&lt;/strong&gt; on this box and started the agent installation. The installation process asks for the user identity of the agent process and I specified the identity as AgentUser. About 15 seconds in into the process, the agent installation has trouble. Apparently connecting to the controller failed.     &lt;br /&gt;&amp;#xA0;&amp;#xA0; &lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/AgentInstallationIssue_2.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="108" alt="AgentInstallationIssue" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/AgentInstallationIssue_thumb.jpg" width="571" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;To start troubleshooting, I switched to the VSTTController machine, turn on the security auditing on the VSTTController machine as described above and then switched back to the VSTTAgent1 machine and clicked Retry on the dialog. As expected it fails again. Now when I switched to the VSTTController box and looked at the Event Viewer, under Security folder, I see the following event. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/AuthFailure_2.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="399" alt="AuthFailure" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/AuthFailure_thumb.jpg" width="355" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;The VSTTController machine is rejecting the logon VSTTAgent1\Administrator. This is for good reason. The Administrator passwords are intentionally not the same!     &lt;br /&gt;    &lt;br /&gt;It is easy to see why the agent installation connects to the controller box under the identity of the person who is installing the Agent. The user that is installing the agent is supposed to be part of the Administrators that administer the controller and agents. The act of installing an Agent and connecting to a controller makes the agent to be registered with the controller.     &lt;br /&gt;This needs special permissions.&lt;/p&gt;  &lt;p&gt;One thing we can do now is to adjust the administrator passwords to be the same. I don't particularly like the idea, since I don't want Administrators of one box to automatically connect to other boxes.    &lt;br /&gt;    &lt;br /&gt;So what I decided to do is to add a user AgentAdmin on the VSTTAgent1 machine and add it to the Administrators group. The idea is that I will restart the Agent installation as AgentAdmin, not as Administrator. Since AgentAdmin is part of the Administrators group on VSTTAgent1 machine, the installation should work fine. On the VSTTController machine,     &lt;br /&gt;I need to add the same user AgentAdmin with the same password. However VSTTController\AgentAdmin &lt;strong&gt;will not be part of the Administrators group on VSTTController box.&lt;/strong&gt; The idea is to not unnecessarily grant permissions that are not required.     &lt;br /&gt;    &lt;br /&gt;So at this point, here is what I have on each box&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="371" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="215"&gt;&lt;strong&gt;VSTTController&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="154"&gt;&lt;strong&gt;VSTTAgent1&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;ForceGuest Off&lt;/td&gt;        &lt;td valign="top" width="161"&gt;ForceGuest ON&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;AgentAdmin as a &lt;strong&gt;normal user&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="161"&gt;AgentAdmin user part of the Administrators group&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;CSUser as a normal user. The controller service is running under this user&lt;/td&gt;        &lt;td valign="top" width="163"&gt;AgentUser as a normal user. This is the intended identity under which the agent should be running&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;         &lt;p&gt;An empty TeamTestAgentService group            &lt;br /&gt;An empty TeamTestControllerAdmins group             &lt;br /&gt;An empty TeamTestControllerUsers group&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="164"&gt;N/A&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;Security Audit turned on &lt;/td&gt;        &lt;td valign="top" width="164"&gt;Security Audit off&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;With this arrangement, I logged off as an Administrator on the VSTTAgent1 box and then logged in back as a AgentAdmin.    &lt;br /&gt;    &lt;br /&gt;But before I proceed, I will let you in on a cool trick. The .NET tracing's default trace listener writes the trace using the API called OutputDebugString and you can view the output in real time using a tool called DebugView. DebugView is a tool that is freely downloadable from the Technet. Go &lt;a href="http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx"&gt;here&lt;/a&gt; to download.What this means is that you don't need to configure file based trace listeners, and keep refreshing the file editor to see the latest contents. Since I wanted to see the controller's trace messages, I switched to the VSTTController box, edited the QtController.exe.Config file (under &amp;lt;rootdrive&amp;gt;:\Program Files\Microsoft Visual Studio 9.0 Team Test Load Agent\LoadTest), and adjusted the EqtTraceLevel to a value of &amp;quot;4&amp;quot; like shown below, saved the file and restarted the controller service for the settings to take effect. &lt;/p&gt;  &lt;p&gt;&amp;lt;switches&amp;gt;    &lt;br /&gt;&amp;#xA0; &amp;lt;!-- You must use integral values for &amp;quot;value&amp;quot;.     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. --&amp;gt;     &lt;br /&gt;&amp;#xA0; &amp;lt;add name=&amp;quot;EqtTraceLevel&amp;quot; value=&amp;quot;4&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;lt;/switches&amp;gt;&lt;/p&gt;  &lt;p&gt;Once I did this, I fired up the DebugView. You should see something like this on the VSTTController box. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/DebugView_4.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="213" alt="DebugView" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/DebugView_thumb_1.jpg" width="765" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now that I have both the security audit and the controller tracing on the VSTTController box, I came back to the VSTTAgent1 box and started the install process. Remember that now I am logged in on the VSTTAgent1 Box as AgentAdmin, which is part of the VSTTAgent1\Administrators group. &lt;/p&gt;  &lt;p&gt;The Agent installation fails again. On the VSTTController box, I look at the event viewer. I see a successful logon of the AgentAdmin. The Logon type = 3 which means that this is a network logon. So we made progress. We are able to authenticate to the VSTTContoller machine as VSTTController\AgentAdmin from VSTTAgent1 machine using VSTTAgent1\AgentAdmin principal.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/Successlogin_2.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="349" alt="Successlogin" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/Successlogin_thumb.jpg" width="307" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;The next thing to look at is the QtController's trace messages from the DebugView tool. The trace messages show that the controller service is checking for group membership of this authenticated principal (user) AgentAdmin.&amp;#xA0; It is checking to see if the AgentAdmin is a member of TestTestControllerUsers or TeamTestControllerAdmins group. Since I did not add the AgentAdmin as part of any group on the VSTTController box, the membership check fails and controller returns an error which is showing up as an installation failure on VSTTAgent1 machine.     &lt;br /&gt;    &lt;br /&gt;To fix the error it is not clear to me as to what group I need to add the AgentAdmin user to     &lt;br /&gt;on the VSTTController box. At first I tried adding the AgentAdmin to the TeamTestControllerUsers group, went back to the VSTTAgent1 box and retried the installation. Even though the installation was successful, the agent was never registered with the controller. I could have tried to fix through other means, but decided to try this through the user scenario. So I added the AgentAdmin as part of the TestTestControllerAdmins group on the VSTTController box. I turned the security auditing on on the VSTTAgent1 machine too, just to aid in debugging. &lt;/p&gt;  &lt;p&gt;I uninstalled the agent from the VSTTAgent1 box and&amp;#xA0; attempted a reinstall of the Agent.    &lt;br /&gt;Here is what I have just before the reinstall of the Agent on VSTTAgent1 machine&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="371" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="215"&gt;&lt;strong&gt;VSTTController&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="154"&gt;&lt;strong&gt;VSTTAgent1&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;ForceGuest Off&lt;/td&gt;        &lt;td valign="top" width="161"&gt;ForceGuest ON&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;AgentAdmin as a &lt;strong&gt;normal user            &lt;br /&gt;and part of the TeamTestControllerAdmins&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="161"&gt;AgentAdmin user part of the Administrators group&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;CSUser as a normal user. The controller service is running under this user&lt;/td&gt;        &lt;td valign="top" width="163"&gt;AgentUser as a normal user. This is the intended identity under which the agent should be running&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;         &lt;p&gt;Empty TeamTestAgentService group&amp;#xA0; &lt;br /&gt;            &lt;br /&gt;TeamTestControllerAdmins group             &lt;br /&gt;has&amp;#xA0; AgentAdmin as a member             &lt;br /&gt;            &lt;br /&gt;Empty TeamTestControllerUsers &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="164"&gt;N/A&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;Security Audit turned on &lt;/td&gt;        &lt;td valign="top" width="164"&gt;Security Audit &lt;strong&gt;ON&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The installation seems to be successful. On the VSTTController machine I see trace messages showing that the installation went well and the VSTTAGENT1 is added to the AgentManager. So far so good. &lt;/p&gt;  &lt;p&gt;Now that the installation of the agent is successful, I really don't see the point of having the AgentAdmin as a user on the VSTTController machine or on the VSTTAgent1 machine. I want to delete this account so that I can reduce any unnecessary user accounts with the same passwords floating around. So I deleted the AgentAdmin account from both the VSTTController and VSTTAgent1 machines ( first I need to logoff as AgentAdmin on the VSTTAgent1 box, log back in as Administrator before deleting the AgentAdmin user). With the AgentAdmin account deleted from both the machines, here is the configuration&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="371" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="215"&gt;&lt;strong&gt;VSTTController&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="154"&gt;&lt;strong&gt;VSTTAgent1&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;ForceGuest Off&lt;/td&gt;        &lt;td valign="top" width="161"&gt;ForceGuest ON&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;CSUser as a normal user. The controller service is running under this user&lt;/td&gt;        &lt;td valign="top" width="163"&gt;AgentUser as a normal user. This is the intended identity under which the agent should be running&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;         &lt;p&gt;Empty TeamTestAgentService group            &lt;br /&gt;Empty TeamTestControllerAdmins group             &lt;br /&gt;Empty TeamTestControllerUsers group&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="164"&gt;N/A&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;Security Audit turned on &lt;/td&gt;        &lt;td valign="top" width="164"&gt;Security Audit &lt;strong&gt;ON&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The Agent installation suggested a reboot after the installation so I did that.    &lt;br /&gt;After the reboot when I logged into the VSTTAgent1 box as an Administrator and opened the event viewer. I am expecting that the Agent service will not be able to connect to the controller. Why? The agent is running as VSTTAgent1\AgentUser and there is no corresponding user on the VSTTController box. So Agent should fail to connect.     &lt;br /&gt;Sure enough the event viewer on VSTTAGent1 machine and the event viewer on the VSTTController machine both point to the failed logon of VSTTAgent1\AgentUser on VSTTController machine.     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/FailedAgentUser_2.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="388" alt="FailedAgentUser" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/FailedAgentUser_thumb.jpg" width="343" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Since we need the agent to connect to controller, we must add the AgentUser to the VSTTController machine with the same password as it has on VSTTAgent1 machine.    &lt;br /&gt;Even after adding this, the agent is still not happy since it still can't connect yo the controller service. Looking at the debug view, you can figure out that the AgentUser needs to be part of the TeamTestAgentService group. So I added the AgentUser to the TeamTestAgentService group. Still no success.&amp;#xA0;&amp;#xA0; &lt;br /&gt;Looking at the Event viewer on VSTTAgent1, I find that the VSTTController\CSUser is trying to authenticate to VSTTAgent1 machine. This because the controller wants to callback to&amp;#xA0; the agent on a different connection and that connection needs to be authenticated.     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="391" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/image_thumb.png" width="347" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;The auth fails due to the fact that we have force guest on and we don't have CSUser as a local user on VSTTAgent1. Lets fix this now. After fixing, and rebooting, this is what I have for configuration&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="371" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="215"&gt;&lt;strong&gt;VSTTController&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="154"&gt;&lt;strong&gt;VSTTAgent1&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="231"&gt;ForceGuest Off&lt;/td&gt;        &lt;td valign="top" width="161"&gt;ForceGuest Off&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;CSUser as a normal user. The controller service is running under this user&lt;/td&gt;        &lt;td valign="top" width="163"&gt;CSUser as a normal user. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;The AgentUser as a normal user.&lt;/td&gt;        &lt;td valign="top" width="163"&gt;AgentUser as a normal user. This is the intended identity under which the agent should be running&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;         &lt;p&gt;TeamTestAgentService group contains the AgentUser            &lt;br /&gt;Empty TeamTestControllerAdmins TeamTestControllerUsers group contains AgentUser&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="164"&gt;N/A&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="234"&gt;Security Audit turned on &lt;/td&gt;        &lt;td valign="top" width="164"&gt;Security Audit &lt;strong&gt;ON&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;That does it. The agent and controller are now happy and are communicating to each other. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Installing the Client and getting it to connect to the controller&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I created a ClientUser on the VSTTClient machine. I installed VSTT, logged off and logged in back again a VSTTClient\ClientUser. I fired up VS, created a test project, specified VSTTController as the remote controller and started a run. As expected, the VS is trying to    &lt;br /&gt;open an authenticated connection to the VSTTControlelr as VSTTClient\ClientUser. Since that user is not defined on the VSTTController machine, the logon fails. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;a href="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="325" alt="image" src="http://blogs.msdn.com/blogfiles/dgorti/WindowsLiveWriter/VSTTControllerandAgentsetup_96FA/image_thumb_1.png" width="289" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;The fix is to add the ClientUser to the VSTTController box and then to the TeamTestControllerUsers group.     &lt;br /&gt;Even after doing that you would still find that you are able to execute tests.     &lt;br /&gt;Following the same troubleshooting techniques and turning on the security audit on the     &lt;br /&gt;VSTTClient, the VSTTController\CSUser is failing to authenticate to the VSTTClient.     &lt;br /&gt;So the fix is to turn off the force guest poilicy and create the CSUser on the VSTTClient machine.     &lt;br /&gt;    &lt;br /&gt;Now I can run tests in my multi machine workgroup topology.... &lt;/p&gt;  &lt;p&gt;Here is the final recipe for the VSTT Client, Controller and agent setup&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;On all machines in the workgroup, turn off the ForceGuest policy. &lt;/li&gt;    &lt;li&gt;Determine the user account under which the controller is going to run under [CSUser]      &lt;br /&gt;Add this account to *all* the machines - client, controller and agent machines [VSTTClient, VSTTController, and VSTTAgent1 in my case] &lt;/li&gt;    &lt;li&gt;On the controller machine, install the controller. When you install the controller it will      &lt;br /&gt;create a set of user groups mentioned above. &lt;/li&gt;    &lt;li&gt;Determine the account under which the agent is going to run under [AgentUser]. Add the account to the controller machine and to the TeamSystemAgentService Group. &lt;/li&gt;    &lt;li&gt;On the agent machine, create a temporary account called AgentAdmin. Add the account to the Administrators group. Add the AgentAdmin account to the controller machine and to the TeamSystemControllerAdmins user group &lt;/li&gt;    &lt;li&gt;Login to the Agent machine as the AgentAdmin      &lt;br /&gt;Install the agent, specify AgentUser as the user underwhich the server is going to run under &lt;/li&gt;    &lt;li&gt;Once the install is complete, on the Agent machine, logoff as AgentAdmin, log back in as Administator and delete the AgentAdmin account. Delete the AgentAdmin account on the Controller machine. There is no need for this account any more. &lt;/li&gt;    &lt;li&gt;Determine the account under which you are going to run the Visual Studio on the      &lt;br /&gt;client machine. [ClientUser on VSTTClient].&amp;#xA0; Add the account to the controller machine with the same password. On the controller machine, add the client user to the TeamSystemControllerUsers group. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Thats it. I hope this article showed you in detail how to install controller and agent in a workgroup and troubleshoot any authentication issues using the DebugView and Security Audit policy. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5252161" width="1" height="1"&gt;</description></item><item><title>Querying on WorkItem Links through the API</title><link>http://blogs.msdn.com/b/dgorti/archive/2007/09/26/querying-on-workitem-links-through-the-api.aspx</link><pubDate>Thu, 27 Sep 2007 01:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5153563</guid><dc:creator>dgorti</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=5153563</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2007/09/26/querying-on-workitem-links-through-the-api.aspx#comments</comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;In Rosario Team Foundation Server, significant new functionality is added for liking work item types&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/bharry/archive/2007/08/06/work-item-tracking-enhancements-in-the-aug-rosario-ctp.aspx"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;http://blogs.msdn.com/bharry/archive/2007/08/06/work-item-tracking-enhancements-in-the-aug-rosario-ctp.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://blogs.msdn.com/teams_wit_tools/archive/tags/Rosario/default.aspx"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;http://blogs.msdn.com/teams_wit_tools/archive/tags/Rosario/default.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;BR&gt;&lt;BR&gt;Here, I will try to describe how to query on link through the work item API. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;First let’s get a list of work item types in the server. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;After the obligatory logging in into the TFS and getting the Work Item Store, you need to go to a &lt;BR&gt;specific project and then get the work item types defined for that project.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Here is a code snippet &lt;BR&gt;that prints all the work item types in a project&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t202 path="m,l,21600r21600,l21600,xe" o:spt="202" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t"&gt;&lt;/v:path&gt;&lt;/v:shapetype&gt;&lt;v:shape id=_x0000_s1030 style="WIDTH: 457.1pt; HEIGHT: 139.3pt; mso-left-percent: -10001; mso-top-percent: -10001; mso-position-horizontal: absolute; mso-position-horizontal-relative: char; mso-position-vertical: absolute; mso-position-vertical-relative: line; mso-width-relative: margin; mso-height-relative: margin" type="#_x0000_t202"&gt;&lt;v:textbox&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TeamFoundationServer&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; TFS;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItemStore&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; WIStore;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TFS = &lt;SPAN style="COLOR: #2b91af"&gt;TeamFoundationServerFactory&lt;/SPAN&gt;.GetServer(http://&lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;your tfs server&amp;gt;:&amp;lt;port typically = 8080&amp;gt;"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WIStore = TFS.GetService(&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemStore&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;WorkItemStore&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; TeamProject = WIStore.Projects[&lt;SPAN style="COLOR: #a31515"&gt;"MyProject"&lt;/SPAN&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItemTypeCollection&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; workItemTypes = TeamProject.WorkItemTypes;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemType&lt;/SPAN&gt; workItemType &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; workItemTypes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;.WriteLine(workItemType.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;?xml:namespace prefix = w ns = "urn:schemas-microsoft-com:office:word" /&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;v:shapetype id=_x0000_t75 path="m@4@5l@4@11@9@11@9@5xe" o:spt="75" coordsize="21600,21600" stroked="f" filled="f" o:preferrelative="t"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Now that we know how to get the work item types, we can look at the work item link types&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;While the work item types are project specific, work item link types are global to all projects.&lt;BR&gt;The code snippet below shows how to get the work item link types. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;v:shape id=_x0000_s1029 style="WIDTH: 457.1pt; HEIGHT: 389.25pt; mso-left-percent: -10001; mso-top-percent: -10001; mso-position-horizontal: absolute; mso-position-horizontal-relative: char; mso-position-vertical: absolute; mso-position-vertical-relative: line; mso-width-relative: margin; mso-height-relative: margin" type="#_x0000_t202"&gt;&lt;v:textbox&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;WorkItemLinkTypeCollection&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt; worItemLinkTypes = WIStore.WorkItemLinkTypes;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemLinkType&lt;/SPAN&gt; workItemLinkType &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; worItemLinkTypes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"-----------------------------------------"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Base ReferenceName: {0}"&lt;/SPAN&gt;, workItemLinkType.BaseReferenceName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Id: {0}"&lt;/SPAN&gt;, workItemLinkType.Id);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Name: {0}"&lt;/SPAN&gt;, workItemLinkType.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"IsDirectional: {0}"&lt;/SPAN&gt;, workItemLinkType.IsDirectional);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"IsForwardLink: {0}"&lt;/SPAN&gt;, workItemLinkType.IsForwardLink);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"IsNonCircular: {0}"&lt;/SPAN&gt;, workItemLinkType.IsNonCircular);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"IsOneToMany: {0}"&lt;/SPAN&gt;, workItemLinkType.IsOneToMany);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"LinkTopology: {0}"&lt;/SPAN&gt;, workItemLinkType.LinkTopology.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemLinkType&lt;/SPAN&gt; workItemLinkTypeReverse = workItemLinkType.Reverse;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\t...."&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tId: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.Id);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tName: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tIsDirectional: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.IsDirectional);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tIsForwardLink: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.IsForwardLink);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tIsNonCircular: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.IsNonCircular);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tIsOneToMany: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.IsOneToMany);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\tLinkTopology: {0}"&lt;/SPAN&gt;, workItemLinkTypeReverse.LinkTopology.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;When you run the code&lt;SPAN style="mso-tab-count: 1"&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; &lt;/SPAN&gt;it prints something like&lt;BR&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;Base ReferenceName: Microsoft.VSTS.Common.Produces&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;Id: 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;Name: Produces&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;IsDirectional: True&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;IsForwardLink: True&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;IsNonCircular: True&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;IsOneToMany: False&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;....&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Id: -4&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Name: Is Produced By&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IsDirectional: True&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IsForwardLink: False&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IsNonCircular: True&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IsOneToMany: False&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So it seems that a “Relation” is represented by two “&lt;B style="mso-bidi-font-weight: normal"&gt;Work Item Link Type&lt;/B&gt;” instances.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Each direction of the “relation” is a work item link type. The other direction is the “reverse” work item link type.&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Let’s take a concrete example:&lt;BR&gt;A feature is produced by one or more deliverables. A deliverable produces one or more features. &lt;BR&gt;This relation is a many to many relation. This relation has a BaseReferenceName – “Produces” and is represented by two work item link type instances. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Features Is Produced by&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Deliverable&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Deliverable Produces Feature.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Each work item link type has a “Reverse” property that points to its counterpart. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Once I got the work item types and work item link types, I tried to see if there are constraints on what link types a work item type can have. For example, can a feature have a parent as a deliverable? &lt;BR&gt;Can a deliverable have a parent Task? It seems that given a set of work item types, only certain relations are valid for a work item of a give type. Unfortunately, as of now, this feature is not implemented. &lt;BR&gt;So any work item type can have any relation or link type as you desire.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The team foundation server team is apparently thinking about adding this in the subsequent CTP releases, but nothing is guaranteed. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;B&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Querying on Links&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Let’s take a look at how to query the work item links.&lt;BR&gt;The WorkItemLinks property will give you all the work item links. Since there could be other types of links, the BaseLinkType property is looked at to make sure that this is the work item link. By querying the WorkItemLink.SourceId and TargetId properties, you can discover what the work item is on the other side of the relation. In this case, my feature 9999, is hooked up to a deliverable via a “Produces” relation&lt;BR&gt;and with a “Is Produced By “directional link.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;v:shape id=_x0000_s1028 style="WIDTH: 492.1pt; HEIGHT: 187.05pt; mso-left-percent: -10001; mso-top-percent: -10001; mso-position-horizontal: absolute; mso-position-horizontal-relative: char; mso-position-vertical: absolute; mso-position-vertical-relative: line; mso-width-relative: margin; mso-height-relative: margin" type="#_x0000_t202"&gt;&lt;FONT face=Calibri size=3&gt; &lt;/FONT&gt;&lt;v:textbox&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItem&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; wiFeatureGroup = WIStore.GetWorkItem(9999);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemLink&lt;/SPAN&gt; wiLink &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; wiFeatureGroup.WorkItemLinks)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (wiLink.BaseType == &lt;SPAN style="COLOR: #2b91af"&gt;BaseLinkType&lt;/SPAN&gt;.WorkItemLink)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;(wiLink.LinkType.BaseReferenceName == &lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.VSTS.Common.Produces"&lt;/SPAN&gt; &amp;amp;&amp;amp; wiLink.LinkType.Name == &lt;SPAN style="COLOR: #a31515"&gt;"Is Produced By"&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WorkItem&lt;/SPAN&gt; wiDeliverable = WIStore.GetWorkItem(wiLink.TargetId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"The target WorkItemID is {0} and its type is {1}"&lt;/SPAN&gt;, wiDeliverable.Id, wiDeliverable.Type.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Adding a link&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;Adding a link is simple. You create a link and add it to the collection, then save the work item&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;v:shape id=_x0000_s1027 style="WIDTH: 492.1pt; HEIGHT: 84.3pt; mso-left-percent: -10001; mso-top-percent: -10001; mso-position-horizontal: absolute; mso-position-horizontal-relative: char; mso-position-vertical: absolute; mso-position-vertical-relative: line; mso-width-relative: margin; mso-height-relative: margin" type="#_x0000_t202"&gt;&lt;v:textbox&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItem&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; wiFeatureGroup = WIStore.GetWorkItem(9999);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItemLink&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; wiLink = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;WorkItemLink&lt;/SPAN&gt;(WIStore.WorkItemLinkTypes[&lt;SPAN style="COLOR: #a31515"&gt;"Is Produced By"&lt;/SPAN&gt;], 9999, 8888);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;wiFeatureGroup.WorkItemLinks.Add(wiLink);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;wiFeatureGroup.Save();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;B&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Deleting a link&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;To delete a link, you would need to identity the link you want to delete and call the Remove() method on that. Note that you need to save the WorkItem to persist the changes. &lt;/FONT&gt;&lt;B&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;v:shape id=_x0000_s1026 style="WIDTH: 492.1pt; HEIGHT: 251.15pt; mso-left-percent: -10001; mso-top-percent: -10001; mso-position-horizontal: absolute; mso-position-horizontal-relative: char; mso-position-vertical: absolute; mso-position-vertical-relative: line; mso-width-relative: margin; mso-height-relative: margin" type="#_x0000_t202"&gt;&lt;v:textbox&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkItem&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; wiFeatureGroup = WIStore.GetWorkItem(642);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;WorkItemLink&lt;/SPAN&gt; wiLink &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; wiFeatureGroup.WorkItemLinks)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (wiLink.BaseType == &lt;SPAN style="COLOR: #2b91af"&gt;BaseLinkType&lt;/SPAN&gt;.WorkItemLink)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;(wiLink.LinkType.BaseReferenceName == &lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.VSTS.Common.Produces"&lt;/SPAN&gt; &amp;amp;&amp;amp; wiLink.LinkType.Name == &lt;SPAN style="COLOR: #a31515"&gt;"Is Produced By"&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WorkItem&lt;/SPAN&gt; wiDeliverable = WIStore.GetWorkItem(wiLink.TargetId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (wiDeliverable.Id == 887)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;wiFeatureGroup.WorkItemLinks.Remove(wiLink);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;wiFeatureGroup.Save();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;FONT face=Calibri size=3&gt;All in all, you will generally find that querying, adding and deleting work item links are easy and intuitive. &lt;BR&gt;The ability to add “relations” to work items opens tremendous flexibility and gives you the ability to write cool new applications that use the power of TFS work item store. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: 89.25pt"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5153563" width="1" height="1"&gt;</description></item><item><title>VSTT Controller, agent in a workgroup</title><link>http://blogs.msdn.com/b/dgorti/archive/2007/09/21/vstt-controller-agent-in-a-workgroup.aspx</link><pubDate>Fri, 21 Sep 2007 17:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5034594</guid><dc:creator>dgorti</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=5034594</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2007/09/21/vstt-controller-agent-in-a-workgroup.aspx#comments</comments><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;So I moved from the networking group to Visual Studio Team System Test. Recently, I was investigating an issue where the client, controller and agent are not working together &lt;BR&gt;when in a workgroup topology. In other words, the machines that are running the client, controller service, and agent service are *non* domain joined and are &lt;BR&gt;part of a workgroup. In this situation, the client is simply failing to connect to the controller. The client gets the message&lt;BR&gt;"The server rejected the client's credentials - Log on failed". &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;For this discussion let’s say I&amp;nbsp;have&amp;nbsp;Machine CLEINT with user Tony. The machine that is running controller (lets say CONTROLLER) &amp;nbsp;has&amp;nbsp;the same user and password&amp;nbsp;&amp;nbsp;Tony. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;I started investigating this issue by enabling the security audit&amp;nbsp;in the security&amp;nbsp;policy. In examining the security audit log, I found that the user on the client &lt;BR&gt;machine was rejected. The message goes like "Bad user name or password, user Tony, Domain CLIENT". On the first thought it kind of makes sense that the user &lt;BR&gt;CLIENT\Tony will be unknown to CONTROLLER. However, the windows workgroup security needs to enable this scenario since there is no central &lt;BR&gt;domain controller. So CLIENT\Tony should be able to authenticate to CONTROLLER as CONTROLLER\Tony. This scenario should work. So what gives?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;The next thing&amp;nbsp;I tried is&amp;nbsp;to simply map a network share from CLIENT to&amp;nbsp;CONTROLLER, something like &lt;A href="file://controller/c$"&gt;&lt;FONT color=#0000ff&gt;\\controller\c$&lt;/FONT&gt;&lt;/A&gt;. Since both CLIENT and CONTROLLER &lt;BR&gt;have Tony as the interactive user, this file share mapping should work. (I already enabled the firewall for this). What I&amp;nbsp;got is a dialog box asking me for credentials. &lt;BR&gt;The strange thing is that the user box is grayed out and says&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'"&gt; CONTROLLER\Guest.&lt;/SPAN&gt;&lt;/STRONG&gt; I wondered why it is forcing me to login as guest.&amp;nbsp; A quick call to &lt;BR&gt;the security team gave me the clue. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;For&amp;nbsp;Windows XP, in a workgroup situation, there is a setting that forces all NETWORK logins as GUEST. Which means that even if you &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'"&gt;are trying to authenticate with a legitimate user and password credentials, it will force you to login as GUEST.&amp;nbsp;Clearly,&amp;nbsp;this is failing &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'"&gt;because I am&amp;nbsp;trying to login as Tony and&amp;nbsp;not as Guest. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;The fix is to edit the registry&amp;nbsp;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ForceGuest &lt;BR&gt;and set the value to 0. This will remove the restriction of forcing the network logins as "Guest". Once I set this&amp;nbsp;value to&amp;nbsp;0 on *all* the machines (client, controller and agent) and rebooted &amp;nbsp;&lt;BR&gt;the machines, it all worked perfectly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;To recap, &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;1. Windows XP "ForceGuest" is on by default in a workgroup scenario, which means all network logins are allowed as Guest only..&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;2. &amp;nbsp;Set the registry key to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ForceGuest to 0 to remove this restriction&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;3. Reboot after applying the security setting&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;I will post a more detailed article on the controller, agent and client setup, users and permissions shortly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5034594" width="1" height="1"&gt;</description></item><item><title>Using a Network Monitor</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/10/29/486887.aspx</link><pubDate>Sun, 30 Oct 2005 05:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486887</guid><dc:creator>dgorti</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=486887</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/10/29/486887.aspx#comments</comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;These days connected applications are everywhere. Web Services and Indigo based applications are used to hook up various services over the internet. When something goes wrong you can debug all you want but ultimately you need to look at what is really going on the wire. Network Monitor is your friend. I am surprised how many people are not really aware of this tool called Network Monitor. Many people who have heard about it think that it is too complex to capture network traffic and understand the traffic. &lt;BR&gt;&lt;BR&gt;In this article I would like explain in easy to understand terms, how to install a network monitor, how to capture traffic, how to save it and how to interpret it. My belief is that once you understand this and used the tool, you will wonder how you ever lived without it. Let’s jump in.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;U&gt;How to install a Network Monitor.&lt;/U&gt;&lt;BR&gt;You might want to know that Network Monitor is a free tool. &lt;BR&gt;Go to Control Panel, Add Remove Programs applet. &lt;BR&gt;Then choose Add Remove Windows Components&lt;BR&gt;Then Select Management and Monitoring Tools and click details. &lt;BR&gt;Choose Network Monitor and proceed with the installation. &lt;BR&gt;You may be prompted for the Windows Installation CD&lt;BR&gt;After the installation, you will see the Network Monitor in the Administrative Tools.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;U&gt;Launching the Network Monitor for the first time.&lt;BR&gt;&lt;/U&gt;When you launch the Network Monitor for the first time you will see a dialog that says “Please specify the network on which you want to capture the data”.&lt;BR&gt;What does this mean?&lt;BR&gt;Network Monitor captures data on a SPECIFIC network adapter. Even if you have only one physical network card, you may have more than one adapter. Don’t worry about this. It will be clear in a second. &lt;BR&gt;Click OK to this dialog. &lt;BR&gt;The dialog that pops up next [You can access the same dialog through the Capture/Networks menu option] is the one where you pick the “Network” you want to monitor. Expand the Local Computer node. You will see one or more Networks. &lt;BR&gt;Which one to choose? Well it depends. &lt;BR&gt;If you have a computer with one network card, simply choose the LAN Connection and click OK&lt;BR&gt;If you have a computer with more than one network card, you have to choose one. &lt;BR&gt;Open a command prompt and type IPCONFIG /all. Then for each Network interface, note down the physical address or MAC address. Once you know the MAC Address, &lt;BR&gt;in the properties windows of the “Select a network” dialog we are talking about, &lt;BR&gt;choose the network whose MAC address matches the MAC address of the network you want to monitor. Then Click OK.&lt;U&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;U&gt;Using Network Monitor.&lt;BR&gt;&lt;/U&gt;Once you have selected a network to monitor, simply press the button that looks like the PLAY button on the toolbar or choose Capture/Start or press F10. &lt;BR&gt;You should see some activity in the Frames per second and other bars. Launch a browser and go to a site. You should see some more activity. If you don’t see any activity on the screen, then you have selected a wrong network. Repeat #2.&lt;U&gt;&lt;BR&gt;&lt;BR&gt;At this point you can run any application including the one you want to debug. &lt;BR&gt;The traffic generated by the application is captured. When you are ready to stop &lt;BR&gt;capturing p&lt;/U&gt;ress the stop button or select Capture/Stop or press F11. &lt;BR&gt;To display what you just captured, press F12. &lt;BR&gt;To save the capture use File/Save as. &lt;BR&gt;That’s it you have a capture file. You can send it to other people or look at it later. &lt;U&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;4.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;U&gt;What is in a capture file?&lt;BR&gt;&lt;/U&gt;You might be wondering what exactly is in a capture file. The capture file contains every single frame that the computer received or sent on the “network” you chose. Even if you capture for a very small amount of time, you can get a &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:place w:st="on"&gt;LOT&lt;/st1:place&gt; of frames. &lt;BR&gt;But you don’t need to worry. Network Monitor has a lot of capabilities to filter and sort.&lt;U&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;5.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;U&gt;How do I find what I want in the capture file?&lt;/U&gt;&lt;BR&gt;When you are looking at a capture you will find that there are several columns. First is the frame number. When you are explaining the issue to someone you can say something like&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;“I see something interesting in frame 999”. Then you can see the Time, Source MAC Address, Dest MAC address, Protocol, Description, etc. You may not find the columns exactly in the order I described but you can order the columns by drag and drop.&lt;BR&gt;&lt;BR&gt;The protocol column is very interesting. This column tells you what the protocol is for the frame captured. On a network a lot of things are going on. On my computer I see HTTTP, BONE, ARP, RARP, DNS, TCP, ICMP6 among many other things. &lt;BR&gt;&lt;BR&gt;Let’s say you are having an issue with one of your HTTP requests. You want to only &lt;BR&gt;look at the HTTP requests and filter out the noise&lt;BR&gt;&lt;BR&gt;Click on the funnel toolbar or choose Display/Filter or press F8. You will see a filter dialog. Double click on Protocol=Any line. Click Disable All. AT this point all the protocols are disabled. Then Click on HTTP [Use the scroll bars to find HTTP] and enable the protocol. Click OK. &lt;BR&gt;&lt;BR&gt;Now you should see Protocol=HTTP. This means that the current filter only shows HTTP protocol. Now you can see only HTTP frames. Note that all the other protocols are still there in the capture, you are only seeing the HTTP frames. There is a way to not EVEN CAPTURE other protocols – this is achieved by the CAPTURE filter. We will not discuss that now. &lt;BR&gt;&lt;BR&gt;OK now you are looking at HTTP frames. How to make sense of these? At this point You need to have knowledge on HTTP protocol and how to interpret the protocol. &lt;BR&gt;If you double click it shows you the complete details of the HTTP protocol information in each packet.&lt;BR&gt;Let me know if this is helpful and if you need more information. &lt;U&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=486887" width="1" height="1"&gt;</description></item><item><title>Getting SubnetMask through System.Net.NetworkInformation</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/10/04/477078.aspx</link><pubDate>Wed, 05 Oct 2005 00:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:477078</guid><dc:creator>dgorti</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=477078</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/10/04/477078.aspx#comments</comments><description>&lt;P&gt;Some people have asked me how to get the SubnetMask for the network interfafce. &lt;BR&gt;The subnet mask is valid only for IPv4. &lt;BR&gt;The solution&amp;nbsp;may not jump at you since there is no property called SubnetMask,&lt;BR&gt;however there is a property called IPv4Mask. &lt;BR&gt;Here is the code to get the subnet mask for each IPv4 address on the box&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;using System;&lt;BR&gt;using System.Net.NetworkInformation;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;public class test&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;public static void Main()&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;NetworkInterface[] Interfaces = NetworkInterface.GetAllNetworkInterfaces();&lt;BR&gt;&amp;nbsp;&amp;nbsp;foreach(NetworkInterface Interface in Interfaces)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Interface.NetworkInterfaceType == NetworkInterfaceType.Loopback) continue;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(Interface.Description);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UnicastIPAddressInformationCollection UnicastIPInfoCol = Interface.GetIPProperties().UnicastAddresses;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach(UnicastIPAddressInformation UnicatIPInfo in UnicastIPInfoCol)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\tIP Address is {0}", UnicatIPInfo.Address);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\tSubnet Mask is {0}", UnicatIPInfo.IPv4Mask);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=477078" width="1" height="1"&gt;</description></item><item><title>Using System.Net Tracing</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/09/18/471003.aspx</link><pubDate>Mon, 19 Sep 2005 02:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471003</guid><dc:creator>dgorti</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=471003</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/09/18/471003.aspx#comments</comments><description>&lt;P&gt;In Whidbey (.NET Framework 2.0) System.Net has a new feature called Tracing. &lt;BR&gt;This uses the builtin CLR Tracing functionality. What is interesting about the System.Net Tracing is that&lt;BR&gt;You can easily&amp;nbsp; see the data that is being sent or received without having to use the NETMON. &lt;BR&gt;&lt;BR&gt;If you have used Network Monitor tools like NETMON/Ethereal you will find that &lt;BR&gt;there is so much noise that you need to weed through. This can be partially addressed through &lt;BR&gt;capture filters and display filters. But then looking at a frame in the capture you can't&lt;BR&gt;easily determine which process issued that request. Similarly if there are multiple threads, &lt;BR&gt;you can't easily determine which thread issued that request. One more thing is that if the &lt;BR&gt;client and server are on the same machine you can;t capture the loop back traffic. Perhaps the most limiting of all &lt;BR&gt;is that if the application is using SSL (https or FTP with SSL) then it is not possible to look at the traffic. &lt;BR&gt;You can at most see the TCP frames with encrypted payload. Not much of use. Right?&lt;BR&gt;&lt;BR&gt;With System.Net, we addressed all these issues. System.Net tracing is &lt;BR&gt;1) Per process&lt;BR&gt;2) Shows threads &lt;BR&gt;3) Works for SSL &lt;BR&gt;4) Works for Loopback.&lt;BR&gt;5) You don't need to recompile the code&lt;BR&gt;&lt;BR&gt;With all these advantages I find the System.Net tracing a very compelling feature that will not be able to live without. &lt;BR&gt;Lets look at some examples. &lt;BR&gt;&lt;BR&gt;1. Consider the following code &lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;//JScript.Net&lt;BR&gt;import System;&lt;BR&gt;import System.Net;&lt;BR&gt;(new WebClient()).DownloadString(&lt;A href="http://www.microsoft.com/office"&gt;http://www.microsoft.com/office&lt;/A&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&lt;/FONT&gt;I wrote the above JScript.Net code. You can compile the code with Jsc &amp;lt;filename&amp;gt;&lt;BR&gt;What if you really want to see the trace for that code and see what is going on the wire?&lt;BR&gt;&lt;BR&gt;You can use the following configuration file. Save this file as app.exe.config file. &lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;&lt;BR&gt;&amp;lt;configuration&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.diagnostics&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;trace autoflush="true" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sources&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source name="System.Net" maxdatasize="1024"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/source&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sources&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sharedListeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="MyTraceFile"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="System.Diagnostics.TextWriterTraceListener"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initializeData="System.Net.trace.log"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sharedListeners&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;switches&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="System.Net" value="Verbose" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/switches&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.diagnostics&amp;gt;&lt;BR&gt;&amp;lt;/configuration&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;lt;!--&lt;BR&gt;You can use these two attributes on the Trace Sources&lt;BR&gt;tracemode="protocolonly"&lt;BR&gt;maxdatasize="1024"&lt;BR&gt;--&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;lt;!--&lt;BR&gt;You can choose from 4 sources&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;lt;source name="System.Net" maxdatasize="1024"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;lt;/source&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#006400&gt;&lt;FONT color=#ff0000&gt;&amp;lt;source name="System.Net.Sockets"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;lt;/source&amp;gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;lt;source name="System.Net.Cache"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;lt;/source&amp;gt;&lt;BR&gt;&amp;lt;source name="System.Net.HttpListener"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;lt;/source&amp;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; &lt;BR&gt;--&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Now when you run the application you will find the log file as System.Net.Trace.Log file&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;System.Net Information: 0 : [3560] HttpWebRequest#33736294 - Request: GET /office HTTP/1.1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;System.Net Information: 0 : [3560] ConnectStream#31914638 - Sending headers&lt;BR&gt;{&lt;BR&gt;Host: &lt;/FONT&gt;&lt;A href="http://www.microsoft.com"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;www.microsoft.com&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;Connection: Keep-Alive&lt;BR&gt;}.&lt;BR&gt;System.Net Information: 0 : [3560] Connection#48285313 - Received status line: Version=1.1, StatusCode=301, StatusDescription=Moved Permanently.&lt;BR&gt;System.Net Information: 0 : [3560] Connection#48285313 - Received headers&lt;BR&gt;{&lt;BR&gt;Connection: Keep-Alive&lt;BR&gt;Proxy-Connection: Keep-Alive&lt;BR&gt;Content-Length: 155&lt;BR&gt;Content-Type: text/html&lt;BR&gt;Date: Mon, 12 Sep 2005 21:51:00 GMT&lt;BR&gt;Location: &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/office/"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;http://www.microsoft.com/office/&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"&lt;BR&gt;Server: Microsoft-IIS/6.0&lt;BR&gt;Via: 1.1 MSCORPGATE12&lt;BR&gt;X-Powered-By: ASP.NET&lt;BR&gt;}.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You can see that the log file shows what is being sent on the wire and what headers are being received. &lt;BR&gt;You don't need to use NETMON any more to see what traffic is being sent on the wire. Very good indeed. &lt;BR&gt;&lt;BR&gt;You can also see that we show the objects and hash codes for each object so you can follow an object &lt;BR&gt;using this log file. You can also see &lt;FONT face="Courier New" color=#ff0000&gt;[3560]&lt;FONT face="Times New Roman" color=#000000&gt;as the thread id of the thread that is issuing the request. &lt;BR&gt;&lt;BR&gt;2.What about SSL? What about Local Host?&lt;BR&gt;Lets consider the following code&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;using System;&lt;BR&gt;using System.Collections.Generic;&lt;BR&gt;using System.Text;&lt;BR&gt;using System.Net;&lt;BR&gt;using System.IO;&lt;BR&gt;using System.Net.Security;&lt;BR&gt;using System.Security.Policy;&lt;BR&gt;using System.Security.Cryptography.X509Certificates;&lt;BR&gt;using System.Security.Cryptography;&lt;BR&gt;class Program&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;static void Main(string[] args)&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;Stream s = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;StreamReader sr = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;HttpWebResponse res = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;try{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Hook a callback to verify the remote certificate&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServicePointManager.ServerCertificateValidationCallback =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new RemoteCertificateValidationCallback(MyCertValidationCb);&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpWebRequest req &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = (HttpWebRequest)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WebRequest.Create("&lt;/FONT&gt;&lt;A href="https://localhost/SecureNoClientCerts/test.htm"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;https://localhost/SecureNoClientCerts/test.htm&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#ff0000&gt;");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.Proxy = null;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;res = req.GetResponse() as HttpWebResponse;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = res.GetResponseStream();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sr = new StreamReader(s, Encoding.UTF8);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(sr.ReadToEnd());&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;catch(Exception ex){&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(ex);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;finally{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(res != null) res.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(s != null) s.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(sr != null) sr.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp; public static bool MyCertValidationCb(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object sender, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X509Certificate certificate, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X509Chain chain, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SslPolicyErrors sslPolicyErrors)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((sslPolicyErrors &amp;amp; SslPolicyErrors.RemoteCertificateChainErrors)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == SslPolicyErrors.RemoteCertificateChainErrors)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if ((sslPolicyErrors &amp;amp; SslPolicyErrors.RemoteCertificateNameMismatch)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == SslPolicyErrors.RemoteCertificateNameMismatch)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Zone z;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = Zone.CreateFromUrl(((HttpWebRequest)sender).RequestUri.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (z.SecurityZone == System.Security.SecurityZone.Intranet&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || z.SecurityZone == System.Security.SecurityZone.MyComputer)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;BR&gt;&amp;nbsp; }&amp;nbsp;&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;This code is trying to make an SSL request to the local host. You will also find that the &lt;BR&gt;RemoteCertificationCallback sample. &lt;BR&gt;&lt;BR&gt;You can enable both the Sockets and System.Net sources with the following config file &lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;&lt;BR&gt;&amp;lt;configuration&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.diagnostics&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;trace autoflush="true" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sources&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source name="System.Net" maxdatasize="1024"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/source&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;source name="System.Net.Sockets" maxdatasize="1024"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="MyTraceFile"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/source&amp;gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sources&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sharedListeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="MyTraceFile"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="System.Diagnostics.TextWriterTraceListener"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initializeData="System.Net.trace.log"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sharedListeners&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;switches&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="System.Net" value="Verbose" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;add name="System.Net.Sockets" value="Verbose" /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/switches&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.diagnostics&amp;gt;&lt;BR&gt;&amp;lt;/configuration&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;Here is the log file produced&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;System.Net Verbose: 0 : [3848] WebRequest::Create(&lt;/FONT&gt;&lt;A href="https://localhost/SecureNoClientCerts/test.htm"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;https://localhost/SecureNoClientCerts/test.htm&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#ff0000&gt;)&lt;BR&gt;System.Net Verbose: 0 : [3848] HttpWebRequest#33574638::HttpWebRequest(&lt;/FONT&gt;&lt;A href="https://localhost/SecureNoClientCerts/test.htm#1109589874"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;https://localhost/SecureNoClientCerts/test.htm#1109589874&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#ff0000&gt;)&lt;BR&gt;System.Net Verbose: 0 : [3848] Exiting HttpWebRequest#33574638::HttpWebRequest() &lt;BR&gt;System.Net Verbose: 0 : [3848] Exiting WebRequest::Create() &amp;nbsp;-&amp;gt; HttpWebRequest#33574638&lt;BR&gt;System.Net Information: 0 : [3848] Associating HttpWebRequest#33574638 with ServicePoint#33736294&lt;BR&gt;System.Net Verbose: 0 : [3848] HttpWebRequest#33574638::GetResponse()&lt;BR&gt;System.Net Information: 0 : [3848] Associating Connection#35191196 with HttpWebRequest#33574638&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Socket(InterNetwork#2)&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Socket() &lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Connect(1:443#16777668)&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Connect() &lt;BR&gt;System.Net Information: 0 : [3848] TlsStream#31914638::.ctor(host=localhost, #certs=0)&lt;BR&gt;System.Net Information: 0 : [3848] Associating HttpWebRequest#33574638 with ConnectStream#18796293&lt;BR&gt;System.Net Information: 0 : [3848] HttpWebRequest#33574638 - Request: GET /SecureNoClientCerts/test.htm HTTP/1.1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;System.Net Information: 0 : [3848] SecureChannel#34948909::.ctor(hostname=localhost, #clientCertificates=0)&lt;BR&gt;System.Net Information: 0 : [3848] Enumerating security packages:&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Negotiate&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kerberos&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NTLM&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft Unified Security Protocol Provider&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Schannel&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WDigest&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DPA&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Digest&lt;BR&gt;System.Net Information: 0 : [3848]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSN&lt;BR&gt;System.Net Information: 0 : [3848] SecureChannel#34948909 - Left with 0 client certificates to choose from.&lt;BR&gt;System.Net Information: 0 : [3848] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent&amp;nbsp; = Outbound, scc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = System.Net.SecureCredential)&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = localhost, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=70, returned code=ContinueNeeded).&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Send()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Send&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 16 03 00 00 41 01 00 00-3D 03 00 43 26 02 90 83 : ....A...=..C&amp;amp;...&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000010 : 33 F1 48 D6 4B 74 DB E2-47 6E 7A 3D 55 D2 43 E2 : 3.H.Kt..Gnz=U.C.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000020 : FC 02 CF 0B AF D4 E0 83-40 59 33 00 00 16 00 04 : &lt;/FONT&gt;&lt;A href="mailto:........@Y3"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;........@Y3&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#ff0000&gt;.....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000030 : 00 05 00 0A 00 09 00 64-00 62 00 03 00 06 00 13 : .......d.b......&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000040 : 00 12 00 63 01 00&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : ...c..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Send() &amp;nbsp;-&amp;gt; 70#70&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 16 03 00 06 09&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;&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;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 5#5&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] (printing 1024 out of 1545)&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000005 : 02 00 00 46 03 00 43 26-02 90 92 8B 0F 1A 72 76 : ...F..C&amp;amp;......rv&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000015 : A2 48 A6 F3 3D 43 22 ED-D5 63 15 8E E3 BD 4F AD : .H..=C"..c....O.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000025 : DD 5A F4 42 B3 72 20 2B-0D 00 00 A7 86 54 E0 9B : .Z.B.r +.....T..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000035 : C7 9A 00 FB 5D 3C AC DD-3E D9 50 FC 08 D8 AD 9F : ....]&amp;lt;..&amp;gt;.P.....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000045 : 14 C7 97 AB 56 98 D4 00-04 00 0B 00 05 B7 00 05 : ....V...........&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000055 : B4 00 05 B1 30 82 05 AD-30 82 04 95 A0 03 02 01 : ....0...0.......&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000065 : 02 02 0A 34 74 D0 6D 00-02 00 00 01 2B 30 0D 06 : ...4t.m.....+0..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000075 : 09 2A 86 48 86 F7 0D 01-01 05 05 00 30 77 31 13 : .*.H........0w1.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000085 : 30 11 06 0A 09 92 26 89-93 F2 2C 64 01 19 16 03 : 0.....&amp;amp;...,d....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000095 : 63 6F 6D 31 19 30 17 06-0A 09 92 26 89 93 F2 2C : com1.0.....&amp;amp;...,&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000A5 : 64 01 19 16 09 6D 69 63-72 6F 73 6F 66 74 31 14 : d....microsoft1.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000B5 : 30 12 06 0A 09 92 26 89-93 F2 2C 64 01 19 16 04 : 0.....&amp;amp;...,d....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000C5 : 63 6F 72 70 31 17 30 15-06 0A 09 92 26 89 93 F2 : corp1.0.....&amp;amp;...&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000D5 : 2C 64 01 19 16 07 72 65-64 6D 6F 6E 64 31 16 30 : ,d....redmond1.0&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000E5 : 14 06 03 55 04 03 13 0D-4E 43 4C 43 45 52 54 53 : ...U....NCLCERTS&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000F5 : 45 52 56 45 52 30 1E 17-0D 30 35 30 38 32 31 30 : ERVER0...0508210&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000105 : 30 33 30 32 35 5A 17 0D-30 36 30 38 32 31 30 30 : 03025Z..06082100&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000115 : 34 30 32 35 5A 30 2E 31-2C 30 2A 06 03 55 04 03 : 4025Z0.1,0*..U..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000125 : 13 23 64 67 6F 72 74 69-6C 74 2E 72 65 64 6D 6F : .#dgortilt.redmo&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000135 : 6E 64 2E 63 6F 72 70 2E-6D 69 63 72 6F 73 6F 66 : nd.corp.microsof&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000145 : 74 2E 63 6F 6D 30 81 9F-30 0D 06 09 2A 86 48 86 : t.com0..0...*.H.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000155 : F7 0D 01 01 01 05 00 03-81 8D 00 30 81 89 02 81 : ...........0....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000165 : 81 00 CF E2 93 87 AF 2A-19 56 47 CF E0 2F E3 13 : .......*.VG../..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000175 : B8 4F B7 20 C7 FA 1A 55-5F B0 3E 6E B6 4B 9B DC : .O. ...U_.&amp;gt;n.K..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000185 : 50 1F 7E A7 5A 13 49 6D-8B 4A B1 27 50 91 47 51 : P.~.Z.Im.J.'P.GQ&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000195 : 6A 8D 21 D1 DC 6C C2 AD-1D 38 E2 20 8A 1A 75 24 : j.!..l...8. ..u$&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001A5 : F3 8F 51 E9 BD E7 F9 FE-8D 11 C9 3A 9E 88 B4 D0 : ..Q........:....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001B5 : A3 A9 C7 A6 7B C0 91 D9-1D 10 AE 00 38 C6 A9 8E : ....{.......8...&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001C5 : 27 52 A5 48 5D DD DF 4B-BF F8 D0 43 AE 43 11 0F : 'R.H]..K...C.C..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001D5 : 0D A5 5E 2C A6 0A 37 9C-EF 9B 5A 30 FC D3 8A 54 : ..^,..7...Z0...T&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001E5 : 55 33 02 03 01 00 01 A3-82 03 06 30 82 03 02 30 : U3.........0...0&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000001F5 : 0E 06 03 55 1D 0F 01 01-FF 04 04 03 02 04 F0 30 : ...U...........0&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000205 : 44 06 09 2A 86 48 86 F7-0D 01 09 0F 04 37 30 35 : D..*.H.......705&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000215 : 30 0E 06 08 2A 86 48 86-F7 0D 03 02 02 02 00 80 : 0...*.H.........&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000225 : 30 0E 06 08 2A 86 48 86-F7 0D 03 04 02 02 00 80 : 0...*.H.........&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000235 : 30 07 06 05 2B 0E 03 02-07 30 0A 06 08 2A 86 48 : 0...+....0...*.H&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000245 : 86 F7 0D 03 07 30 1D 06-03 55 1D 0E 04 16 04 14 : .....0...U......&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000255 : 25 9C 39 A7 F3 81 B2 20-79 95 22 C4 BD E3 2E A3 : %.9.... y.".....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000265 : 01 98 E6 AF 30 13 06 03-55 1D 25 04 0C 30 0A 06 : ....0...U.%..0..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000275 : 08 2B 06 01 05 05 07 03-01 30 1F 06 03 55 1D 23 : .+.......0...U.#&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000285 : 04 18 30 16 80 14 53 FA-E2 5F A8 9E B1 10 55 65 : ..0...S.._....Ue&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000295 : E3 53 13 1B 9E EF 2B 23-D8 F5 30 82 01 56 06 03 : .S....+#..0..V..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002A5 : 55 1D 1F 04 82 01 4D 30-82 01 49 30 82 01 45 A0 : U.....M0..I0..E.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002B5 : 82 01 41 A0 82 01 3D 86-81 A8 6C 64 61 70 3A 2F : ..A...=...ldap:/&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002C5 : 2F 2F 43 4E 3D 4E 43 4C-43 45 52 54 53 45 52 56 : //CN=NCLCERTSERV&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002D5 : 45 52 28 32 29 2C 43 4E-3D 77 69 74 34 2C 43 4E : ER(2),CN=wit4,CN&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002E5 : 3D 43 44 50 2C 43 4E 3D-50 75 62 6C 69 63 25 32 : =CDP,CN=Public%2&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000002F5 : 30 4B 65 79 25 32 30 53-65 72 76 69 63 65 73 2C : 0Key%20Services,&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000305 : 43 4E 3D 53 65 72 76 69-63 65 73 2C 44 43 3D 55 : CN=Services,DC=U&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000315 : 6E 61 76 61 69 6C 61 62-6C 65 43 6F 6E 66 69 67 : navailableConfig&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000325 : 44 4E 3F 63 65 72 74 69-66 69 63 61 74 65 52 65 : DN?certificateRe&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000335 : 76 6F 63 61 74 69 6F 6E-4C 69 73 74 3F 62 61 73 : vocationList?bas&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000345 : 65 3F 6F 62 6A 65 63 74-43 6C 61 73 73 3D 63 52 : e?objectClass=cR&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000355 : 4C 44 69 73 74 72 69 62-75 74 69 6F 6E 50 6F 69 : LDistributionPoi&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000365 : 6E 74 86 48 66 69 6C 65-3A 2F 2F 5C 5C 77 69 74 : nt.Hfile://\\wit&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000375 : 34 2E 72 65 64 6D 6F 6E-64 2E 63 6F 72 70 2E 6D : 4.redmond.corp.m&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000385 : 69 63 72 6F 73 6F 66 74-2E 63 6F 6D 5C 43 65 72 : icrosoft.com\Cer&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000395 : 74 45 6E 72 6F 6C 6C 5C-4E 43 4C 43 45 52 54 53 : tEnroll\NCLCERTS&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003A5 : 45 52 56 45 52 28 32 29-2E 63 72 6C 86 46 68 74 : ERVER(2).crl.Fht&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003B5 : 74 70 3A 2F 2F 77 69 74-34 2E 72 65 64 6D 6F 6E : tp://wit4.redmon&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003C5 : 64 2E 63 6F 72 70 2E 6D-69 63 72 6F 73 6F 66 74 : d.corp.microsoft&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003D5 : 2E 63 6F 6D 2F 43 65 72-74 45 6E 72 6F 6C 6C 2F : .com/CertEnroll/&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003E5 : 4E 43 4C 43 45 52 54 53-45 52 56 45 52 28 32 29 : NCLCERTSERVER(2)&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000003F5 : 2E 63 72 6C 30 81 FA 06-08 2B 06 01 05 05 07 01 : .crl0....+......&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 1545#1545&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 185a20:daf80, targetName = localhost, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(In-Buffer length=1550, Out-Buffer length=204, returned code=ContinueNeeded).&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Send()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Send&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 16 03 00 00 84 10 00 00-80 32 CB FC 3B 3B A6 67 : .........2..;;.g&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000010 : BF F8 89 3F 40 CE 20 E4-79 92 4C 9C 8D 84 4C 77 : ...?@. .y.L...Lw&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000020 : E6 BC 1D EA 59 95 F5 FA-E6 7B 35 40 68 EA 97 23 : &lt;/FONT&gt;&lt;A href="mailto:....Y....{5@h"&gt;&lt;FONT face="Courier New" color=#ff0000&gt;....Y....{5@h&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#ff0000&gt;..#&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000030 : 89 20 DD A5 E1 DD 2C 48-98 2F 2E C5 C3 4B 87 59 : . ....,H./...K.Y&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000040 : C8 86 7F BA 85 CF BC B0-5C 26 1C E7 AA A6 C3 54 : ........\&amp;amp;.....T&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000050 : 55 59 AE B3 3B 04 24 40-18 D5 B3 C8 57 02 83 E2 : UY..;.$@....W...&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000060 : 46 2E 2B EA 1B C1 8E 6D-4A 3C E5 C7 5E 2E 47 24 : F.+....mJ&amp;lt;..^.G$&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000070 : 13 DB 03 30 76 CB C4 19-FA D1 85 11 BD 5B AC A6 : ...0v........[..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000080 : 0D 60 9D E4 FB 6A BA 33-CB 14 03 00 00 01 01 16 : .`...j.3........&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000090 : 03 00 00 38 B9 4C CA CF-CD C2 FF 20 61 43 8E 02 : ...8.L..... aC..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000A0 : 54 03 55 7D 6F 84 BE F9-B2 5D 44 31 1D FF B1 1F : T.U}o....]D1....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000B0 : 0F 45 04 81 ED 09 3A 2E-72 44 3E 37 B1 F6 CE 56 : .E....:.rD&amp;gt;7...V&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 000000C0 : DB 67 11 8A E8 CE 35 23-DF 0B F5 3E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : .g....5#...&amp;gt;&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Send() &amp;nbsp;-&amp;gt; 204#204&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 14 03 00 00 01&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;&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;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 5#5&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000005 : 01&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : .&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 1#1&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 185a20:daf80, targetName = localhost, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(In-Buffer length=6, Out-Buffer length=0, returned code=ContinueNeeded).&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 16 03 00 00 38&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;&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; : ....8&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 5#5&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Receive()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Receive&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000005 : 51 35 A8 FC 48 38 37 66-51 6D A3 A7 0C 10 95 93 : Q5..H87fQm......&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000015 : 6B FF 8A 41 00 38 42 F4-B8 AA 0F C9 DB 71 16 46 : k..A.8B......q.F&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000025 : 67 CA 04 20 F4 EF EB 31-EE BB C7 AD E8 7E B5 76 : g.. ...1.....~.v&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000035 : 8D 63 96 99 96 63 53 3C-&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : .c...cS&amp;lt;&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Receive() &amp;nbsp;-&amp;gt; 56#56&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 185a20:daf80, targetName = localhost, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)&lt;BR&gt;System.Net Information: 0 : [3848] InitializeSecurityContext(In-Buffer length=61, Out-Buffer length=0, returned code=OK).&lt;BR&gt;System.Net Information: 0 : [3848] Remote certificate: [Version]&lt;BR&gt;&amp;nbsp; V3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Subject]&lt;BR&gt;&amp;nbsp; CN=dgortilt.redmond.corp.microsoft.com&lt;BR&gt;&amp;nbsp; Simple Name: dgortilt.redmond.corp.microsoft.com&lt;BR&gt;&amp;nbsp; DNS Name: dgortilt.redmond.corp.microsoft.com&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Issuer]&lt;BR&gt;&amp;nbsp; CN=NCLCERTSERVER, DC=redmond, DC=corp, DC=microsoft, DC=com&lt;BR&gt;&amp;nbsp; Simple Name: NCLCERTSERVER&lt;BR&gt;&amp;nbsp; DNS Name: NCLCERTSERVER&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Serial Number]&lt;BR&gt;&amp;nbsp; 3474D06D00020000012B&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Not Before]&lt;BR&gt;&amp;nbsp; 8/20/2005 5:30:25 PM&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Not After]&lt;BR&gt;&amp;nbsp; 8/20/2006 5:40:25 PM&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Thumbprint]&lt;BR&gt;&amp;nbsp; 19E34D7F445E49ACBD5EEECFF606F10197098F16&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Signature Algorithm]&lt;BR&gt;&amp;nbsp; sha1RSA(1.2.840.113549.1.1.5)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#ff0000&gt;[Public Key]&lt;BR&gt;&amp;nbsp; Algorithm: RSA&lt;BR&gt;&amp;nbsp; Length: 1024&lt;BR&gt;&amp;nbsp; Key Blob: 30 81 89 02 81 81 00 cf e2 93 87 af 2a 19 56 47 cf e0 2f e3 13 b8 4f b7 20 c7 fa 1a 55 5f b0 3e 6e b6 4b 9b dc 50 1f 7e a7 5a 13 49 6d 8b 4a b1 27 50 91 47 51 6a 8d 21 d1 dc 6c c2 ad 1d 38 e2 20 8a 1a 75 24 f3 8f 51 e9 bd e7 f9 fe 8d 11 c9 3a 9e 88 b4 d0 a3 a9 c7 a6 7b c0 91 d9 1d 10 ae 00 38 c6 a9 8e 27 52 a5 48 5d dd df 4b bf f8 d0 43 ae 43 11 0f 0d a5 5e 2c a6 0a 37 9c ef 9b 5a 30 fc d3 8a 54 55 33 02 03 01 ....&lt;BR&gt;System.Net Information: 0 : [3848] SecureChannel#34948909 - Remote certificate has errors:&lt;BR&gt;System.Net Information: 0 : [3848] SecureChannel#34948909 - &amp;nbsp;Certificate name mismatch.&lt;BR&gt;System.Net Information: 0 : [3848] SecureChannel#34948909 - Remote certificate was verified as valid by the user.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Socket#48285313::Send()&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Data from Socket#48285313::Send&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000000 : 17 03 00 00 67 79 FD 10-7F A4 92 38 C5 80 38 EE : ....gy.....8..8.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000010 : 3A 6C 66 B7 0C CC C7 29-0C EC 3C 3B 88 D0 BE 94 : :lf....)..&amp;lt;;....&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000020 : 6E C6 0D 7D B4 12 29 BD-ED 86 05 8C 17 CA 1B 9D : n..}..).........&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000030 : D6 1A D7 65 D9 77 AD 5A-7C 17 E7 1A 78 69 90 B0 : ...e.w.Z|...xi..&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000040 : DB 68 89 D8 F3 56 C2 D4-F8 52 CF EB 4B 1E 38 4B : .h...V...R..K.8K&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000050 : D4 0D AA 5A 5C A4 C4 15-E8 AF F2 79 93 E0 06 37 : ...Z\......y...7&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] 00000060 : 10 CA 42 A9 49 8C B2 AC-33 85 68 80&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : ..B.I...3.h.&lt;BR&gt;System.Net.Sockets Verbose: 0 : [3848] Exiting Socket#48285313::Send() &amp;nbsp;-&amp;gt; 108#108&lt;BR&gt;System.Net Information: 0 : [3848] ConnectStream#18796293 - Sending headers&lt;BR&gt;{&lt;BR&gt;Host: localhost&lt;BR&gt;Connection: Keep-Alive&lt;BR&gt;}.&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;You can see clearly that &lt;/P&gt;
&lt;P&gt;1) The Remote Certificate is being clearly presented in the log file. &lt;BR&gt;2) Any errors in the remote certificate are logged.&lt;BR&gt;3) In this case we are returning true for NAME MISMATCH if the server is local or intranet [Please see the &lt;BR&gt;remore certificate validation callback code]&lt;BR&gt;4) The fact that we accepted the certificate is also logged.&lt;BR&gt;5) Then at the sockets level you can see encrypted data being sent&lt;BR&gt;6) At the System.Net level (application level) you can see the decrypted data.&lt;BR&gt;&lt;BR&gt;You can see now how easy it is to debug SSL apps using the system.Net tracing. &lt;BR&gt;Let me know your comments &lt;BR&gt;&lt;BR&gt;Durgaprasad Gorti&lt;BR&gt;Test Lead&lt;BR&gt;System.Net&lt;BR&gt;Microsoft&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=471003" width="1" height="1"&gt;</description></item><item><title>Only one usage of each socket address (protocol/network address/port) is normally permitted</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/09/18/470766.aspx</link><pubDate>Sun, 18 Sep 2005 07:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470766</guid><dc:creator>dgorti</dc:creator><slash:comments>16</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=470766</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/09/18/470766.aspx#comments</comments><description>&lt;P&gt;Lets say that you are invoking a web service from another web service. Both are on the same box. You might be making authenticated&lt;BR&gt;or unauthenticated calls and perhaps you are setting the KeepAlive = false. &lt;BR&gt;Intermittently, (under load) you might get &lt;FONT color=#ff0000&gt;"Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load)."&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;You might be wondering why are you getting a *SOCKET* Exception...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Here is the scoop&lt;BR&gt;1. When you make authenticated calls, the client is closing connections. And when you are making authenticated calls &lt;BR&gt;repeatedly to the same server, you are making and closing connections repeatedly&lt;BR&gt;2. The same might happen when you are making regular http [un authenticated] calls but setting keep-alive = false. &lt;/P&gt;
&lt;P&gt;When a connection is closed, on the side that is closing the connection the 5 tuple &lt;BR&gt;{ Protocol, Local IP, Local Port, Remote IP, Remote Port} goes into a TIME_WAIT state for 240 seconds by default. &lt;BR&gt;In this case, the protocol is fixed - TCP&lt;BR&gt;the local IP, remote IP and remote PORT are also typically fixed. So the variable is the local port. &lt;BR&gt;What happens is that when you don't bind a port in the range 1024-5000 is used. &lt;BR&gt;So roughly you have 4000 ports. If you use all of them in 4 minutes - meaning roughly you &lt;BR&gt;make 16 web service calls per second for 4 minutes you will exhaust all the ports. That is the cause of this exception. &lt;BR&gt;&lt;BR&gt;OK now how can this be fixed?&lt;BR&gt;1. One of the ways is to increase the dynamic port range. The max by default is 5000. You can set this up to 65534. &lt;BR&gt;HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort is the key to use. &lt;/P&gt;
&lt;P&gt;2. The second thing you can do is once the connection does get into an TIME_WAIT state you can reduce the time it is &lt;BR&gt;in that state, Default is 4 monutes, but you can set this to 30 seconds &lt;BR&gt;HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\TCPTimedWaitDelay is the key to use. &lt;BR&gt;Set this to 30 seconds&lt;/P&gt;
&lt;P&gt;3. If you don't have access to registry you can do this through code. &lt;BR&gt;In System.Net 2.0 we addeed what is called a BindIPEndPOintDelegate&lt;BR&gt;What this does is to give you a chance to choose the local end point for the &lt;BR&gt;connection that is being made.&lt;BR&gt;See &lt;a href="http://blogs.msdn.com/malarch/archive/2005/09/13/466664.aspx"&gt;http://blogs.msdn.com/malarch/archive/2005/09/13/466664.aspx&lt;/A&gt;&lt;BR&gt;for more info. &lt;BR&gt;&lt;BR&gt;Using this, the following sample code attempts to choose between 5001 and 65534 &lt;BR&gt;and wrap around when we reach 65534. &lt;BR&gt;&lt;FONT face="Courier New" color=#ff0000&gt;Req.ServicePoint.BindIPEndPointDelegate &lt;BR&gt;&amp;nbsp;= new BindIPEndPoint(BindIPEndPointCallback);&lt;BR&gt;public static IPEndPoint BindIPEndPointCallback(ServicePoint servicePoint, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IPEndPoint remoteEndPoint, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int retryCount) &lt;BR&gt;{&lt;BR&gt;&amp;nbsp; int port = Interlocked.Increment(ref m_LastBindPortUsed);&amp;nbsp;//increment&lt;BR&gt;&amp;nbsp; Interlocked.CompareExchange(ref m_LastBindPortUsed, 5001, 65534);&lt;BR&gt;&amp;nbsp; if(remoteEndPoint.AddressFamily == AddressFamily.InterNetwork) {&lt;BR&gt;&amp;nbsp;return new IPEndPoint(IPAddress.Any,port);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; else {&lt;BR&gt;&amp;nbsp;return new IPEndPoint(IPAddress.IPv6Any,port);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Durgaprasad Gorti&lt;BR&gt;&lt;A href="mailto:Durgaprasad.Gorti@microsoft.com.dontspam"&gt;Durgaprasad.Gorti@microsoft.com.dontspam&lt;/A&gt;&lt;BR&gt;Test Lead&lt;BR&gt;System.Net&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=470766" width="1" height="1"&gt;</description></item><item><title>I spoke at the PDC 2005</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/09/17/470759.aspx</link><pubDate>Sun, 18 Sep 2005 06:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470759</guid><dc:creator>dgorti</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=470759</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/09/17/470759.aspx#comments</comments><description>&lt;P&gt;I presented System.Net tips and tricks. I did the lunch session on Tuesday and Wednesday. &lt;BR&gt;Lunch sessions are particularly difficult, you only have 45 minutes - You can't present &lt;BR&gt;lengthy topics. &lt;BR&gt;I chose to talk about the System.Net Tracing, Negotiate Stream, SSL Stream, Email with Linked Resources and &lt;BR&gt;then some kerberos information. &lt;BR&gt;&lt;BR&gt;Please let me know what you would like to see in the next conference I might speak in. What are the topics of&lt;BR&gt;interest? &lt;BR&gt;&lt;BR&gt;If you were at the PDC and attened my session, thanks. Let me know your feedback and your comments and suggestions. &lt;/P&gt;
&lt;P&gt;In the next two weeks, I will post all the info I talked about in the PDC. &lt;/P&gt;
&lt;P&gt;Durgaprasad Gorti&lt;BR&gt;Test Lead,&lt;BR&gt; System.Net&lt;BR&gt;Microsoft. &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=470759" width="1" height="1"&gt;</description></item><item><title>Please post your questions to http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=40</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/09/17/470757.aspx</link><pubDate>Sun, 18 Sep 2005 06:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470757</guid><dc:creator>dgorti</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=470757</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/09/17/470757.aspx#comments</comments><description>&lt;P&gt;If you have questions on the System.Net [managed network programming api's]&lt;BR&gt;please post your questions to &lt;BR&gt;&lt;A href="http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=40"&gt;http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=40&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I monitor this forum and so does all of my team. This is your best bet to get your &lt;BR&gt;questions answered. There might be other public news groups, but we are not monitoring those &lt;BR&gt;actively. Please use the forum above.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;U&gt;A few tips for getting your questions answered&lt;BR&gt;&lt;/P&gt;&lt;/U&gt;&lt;/STRONG&gt;
&lt;OL&gt;
&lt;LI&gt;Always tell us the Operating System, Service Pack &lt;/LI&gt;
&lt;LI&gt;Always .NET Framework version, Service Pack&lt;/LI&gt;
&lt;LI&gt;If you can tell us the Exact version number of the System.dll it would be great. &lt;/LI&gt;
&lt;LI&gt;Make your question easy to understand. Use specific examples like &lt;BR&gt;"Machine A does X and Machine B does Y. I exepect Z but I am getting D"&lt;/LI&gt;
&lt;LI&gt;Post your code (snippet). It is so much easier to understand your issue if we can &lt;BR&gt;look at the code quickly&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Good Luck and thanks for posting &amp;nbsp;your questions.&lt;/P&gt;
&lt;P&gt;Durgaprasad Gorti&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=470757" width="1" height="1"&gt;</description></item><item><title>Cookies, Cookie Collection and CookieContainer</title><link>http://blogs.msdn.com/b/dgorti/archive/2005/08/16/452347.aspx</link><pubDate>Tue, 16 Aug 2005 23:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:452347</guid><dc:creator>dgorti</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/dgorti/rsscomments.aspx?WeblogPostID=452347</wfw:commentRss><comments>http://blogs.msdn.com/b/dgorti/archive/2005/08/16/452347.aspx#comments</comments><description>&lt;P&gt;When using System.Net or Web Services, you might want to receive or send cookies, perhaps for session state&lt;BR&gt;maintenance or in some rare situations for proxy authentication. &lt;BR&gt;The first thing we are tempted to do is to access &lt;BR&gt;WebResponse.Cookies collection. But then it returns no cookies. Why?&lt;BR&gt;It turns out that unless you assign a CookieContainer to the WebRequest, you won't be able to get the &lt;BR&gt;WebResponse.Cookies. It is not very intuitive. Why would I need to create a cookie container to get cookies?&lt;BR&gt;Notice that you need to create a cookie container but then you get cookie collection from WebResponse.&lt;BR&gt;Here is some sample code &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;CookieContainer CC = new CookieContainer();&lt;BR&gt;HttpWebRequest Req = (HttpWebRequest) WebRequest.Create("&lt;/SPAN&gt;&lt;A href="http://localhost/CookieTest/first.aspx"&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;http://localhost/CookieTest/first.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;");&lt;BR&gt;Req.Proxy = null;&lt;BR&gt;Req.UseDefaultCredentials = true;&lt;BR&gt;//YOU MUST ASSIGN A COOKIE CONTAINER FOR THE REQUEST TO PULL THE COOKIES&lt;BR&gt;Req.CookieContainer = CC;&lt;BR&gt;Res = (HttpWebResponse)Req.GetResponse();&lt;BR&gt;//DUMP THE COOKIES&lt;BR&gt;Console.WriteLine("----- COOKIES -----");&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;if(Res.Cookies != null &amp;amp;&amp;amp;&amp;nbsp; Res.Cookies.Count != 0)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach(Cookie c in Res.Cookies)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\t" + c.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;BR&gt;else&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("No Cookies");&lt;BR&gt;|}&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;OK fine you might say - but what is the difference between CookieCollection and a CookieContainer?&lt;BR&gt;They kind of look the same.&amp;nbsp; The difference is that the CookieCollection is the cookies obtained for the &lt;BR&gt;SPECIFIC request.&amp;nbsp; CookieContainer is designed to be a store of all the cookies for one more requests. &lt;BR&gt;To that extent, the CookieContainer is designed to be a hashtable of "domain - CookieCollection" pairs. &lt;BR&gt;&lt;BR&gt;What this means is that for the next requests you create, you can safely assign the cookiecontainer from the previous &lt;BR&gt;request. But then you might be wondering whether we send the cookies that we are not supposed to. Fear not. &lt;BR&gt;The CookieContainer is designed to be safe. &lt;BR&gt;When the second request is sent the we look at the URI and the path you are using and send only those cookies &lt;BR&gt;that we can safely send as per the RFC. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;Here is the complete sample for Cookies&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;using System;&lt;BR&gt;using System.Threading;&lt;BR&gt;using System.Net;&lt;BR&gt;using System.Text;&lt;BR&gt;using System.IO;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;public class Test&lt;BR&gt;{&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;public static void Main(string[] args)&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;Stream s = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;StreamReader sr = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;HttpWebResponse Res = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;CookieContainer CC = new CookieContainer();&lt;BR&gt;&amp;nbsp;&amp;nbsp;try&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//----------------------------------------------------&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//FIRST REQUEST&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//----------------------------------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpWebRequest Req = (HttpWebRequest) WebRequest.Create("&lt;/SPAN&gt;&lt;A href="http://localhost/CookieTest/first.aspx"&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;http://localhost/CookieTest/first.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.Proxy = null;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.UseDefaultCredentials = true;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//YOU MUST ASSIGN A COOKIE CONTAINER FOR THE REQUEST TO PULL THE COOKIES&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.CookieContainer = CC;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Res = (HttpWebResponse)Req.GetResponse();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//DUMP THE COOKIES&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("----- COOKIES -----");&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Res.Cookies != null &amp;amp;&amp;amp;&amp;nbsp; Res.Cookies.Count != 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach(Cookie c in Res.Cookies)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\t" + c.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("No Cookies present");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = Res.GetResponseStream();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sr = new StreamReader(s, Encoding.ASCII);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("----- RESPONSE -----");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\t" + sr.ReadToEnd());&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//----------------------------------------------------&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//SECOND REQUEST&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//----------------------------------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req = (HttpWebRequest) WebRequest.Create("&lt;/SPAN&gt;&lt;A href="http://localhost/CookieTest/second.aspx"&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;http://localhost/CookieTest/second.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.Proxy = null;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.UseDefaultCredentials = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//TO TRANSFER COOKIES TO THE NEXT PAGE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Req.CookieContainer = CC;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Res = (HttpWebResponse)Req.GetResponse();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//DUMP THE COOKIES&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("----- COOKIES -----");&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Res.Cookies != null &amp;amp;&amp;amp;&amp;nbsp; Res.Cookies.Count != 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach(Cookie c in Res.Cookies)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\t" + c.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("No Cookies present");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = Res.GetResponseStream();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sr = new StreamReader(s, Encoding.ASCII);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("----- RESPONSE -----");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine("\t" + sr.ReadToEnd());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;catch(Exception ex)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(ex);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;finally&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(sr != null) sr.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(s != null) s.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;Hope you find this useful. Let me know your comments&lt;BR&gt;Also let me know what other topics you want me to blog about. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN-BOTTOM: 12pt"&gt;Just a note that I will be speaking&amp;nbsp;at the PDC 2005 doing a Tips and Tricks&lt;BR&gt;session on System.Net 2.0. I will be covering Tracing, X509 Certificates, Kerberos auth, &lt;BR&gt;SMTP with embedded resources, etc. If there is a particular topic that if interest to you&lt;BR&gt;let me know. &lt;BR&gt;&lt;BR&gt;Durgaprasad Gorti&lt;BR&gt;Test Lead &lt;BR&gt;System.Net&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=452347" width="1" height="1"&gt;</description></item></channel></rss>