<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Visual Studio</title>
        <link>http://agilior.pt/blogs/pedro.rainho/category/63.aspx</link>
        <description>Visual Studio</description>
        <language>pt-PT</language>
        <copyright>Pedro Rainho</copyright>
        <managingEditor>pedro.rainho@agilior.pt</managingEditor>
        <generator>Subtext Version 1.9.0.27</generator>
        <item>
            <title>How to create a Tool Window in Visual Studio</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7589.aspx</link>
            <description>&lt;p&gt;After you create an Add-in you need to create a User Control&lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Documents and Settings/prainho/Local Settings/Temp/WindowsLiveWriter-429641856/supfiles1B7A7828/image[56].png"&gt;&lt;img title="image_thumb[30]" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="335" alt="image_thumb[30]" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateaToolWindowinVisualStudio_F385/image_thumb%5B30%5D_b828c9c7-794a-4357-8cdc-e4669a73b90e.png" width="547" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Then I will have to change the Connect.cs file &lt;/p&gt;  &lt;p&gt;The first thing you need to do is declare 2 fields one for the window it self and other for the user control&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Window &lt;/span&gt;_toolWindow;
&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyAddInToolWindow &lt;/span&gt;_toolWindowControl;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next you will need to change the OnConnection method. This method receives notification that the Add-in is being loaded. This method when it’s generated adds the necessary code to show a add-in icon in the Tools menu.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/summary&amp;gt;
/// &amp;lt;param term='application'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Root object of the host application.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='connectMode'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Describes how the Add-in is being loaded.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='addInInst'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Object representing this Add-in.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;seealso class='IDTExtensibility2' /&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;OnConnection(&lt;span style="color: blue"&gt;object &lt;/span&gt;application, &lt;span style="color: #2b91af"&gt;ext_ConnectMode &lt;/span&gt;connectMode, &lt;span style="color: blue"&gt;object &lt;/span&gt;addInInst, &lt;span style="color: blue"&gt;ref &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Array &lt;/span&gt;custom)
{
    _applicationObject = (&lt;span style="color: #2b91af"&gt;DTE2&lt;/span&gt;)application;
    _addInInstance = (&lt;span style="color: #2b91af"&gt;AddIn&lt;/span&gt;)addInInst;
    &lt;span style="color: blue"&gt;if&lt;/span&gt;(connectMode == &lt;span style="color: #2b91af"&gt;ext_ConnectMode&lt;/span&gt;.ext_cm_UISetup)
    {
        &lt;font color="#0000ff"&gt;...&lt;/font&gt;
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next I need to change this method to enable me to show my tool window. To do that I just need to do this:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/summary&amp;gt;
/// &amp;lt;param term='application'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Root object of the host application.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='connectMode'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Describes how the Add-in is being loaded.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='addInInst'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Object representing this Add-in.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;seealso class='IDTExtensibility2' /&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;OnConnection(&lt;span style="color: blue"&gt;object &lt;/span&gt;application, &lt;span style="color: #2b91af"&gt;ext_ConnectMode &lt;/span&gt;connectMode, &lt;span style="color: blue"&gt;object &lt;/span&gt;addInInst, &lt;span style="color: blue"&gt;ref &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Array &lt;/span&gt;custom)
{
    _applicationObject = (&lt;span style="color: #2b91af"&gt;DTE2&lt;/span&gt;)application;
    _addInInstance = (&lt;span style="color: #2b91af"&gt;AddIn&lt;/span&gt;)addInInst;
    &lt;span style="color: blue"&gt;if&lt;/span&gt;(connectMode == &lt;span style="color: #2b91af"&gt;ext_ConnectMode&lt;/span&gt;.ext_cm_UISetup)
    {
        &lt;span style="color: blue"&gt;...&lt;/span&gt;    &lt;/pre&gt;

&lt;pre class="code"&gt;    }
    &lt;span style="color: blue"&gt;else if &lt;/span&gt;(connectMode == &lt;span style="color: #2b91af"&gt;ext_ConnectMode&lt;/span&gt;.ext_cm_AfterStartup)
    {
        CreateToolWindow();
    }
}&lt;/pre&gt;

&lt;pre class="code"&gt; &lt;/pre&gt;

&lt;p&gt;If connect mode is After Startup, I will show the tool window.&lt;/p&gt;

&lt;p&gt;To show the tool window I just need to call method  “CreateToolWindow2”. This method receives some parameters and one of the parameters is the “Namespace.Usercontrol”, in this case &lt;span style="color: #a31515"&gt;"MyAddin1.MyAddInToolWindow"&lt;/span&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;CreateToolWindow()
{
    &lt;span style="color: blue"&gt;if &lt;/span&gt;(_toolWindow == &lt;span style="color: blue"&gt;null &lt;/span&gt;|| _toolWindow.Visible == &lt;span style="color: blue"&gt;false&lt;/span&gt;)
    {
        &lt;span style="color: blue"&gt;#region &lt;/span&gt;Load Tool Window
        &lt;span style="color: blue"&gt;object &lt;/span&gt;programmableObject = &lt;span style="color: blue"&gt;null&lt;/span&gt;;
        &lt;span style="color: blue"&gt;string &lt;/span&gt;guidString = &lt;span style="color: #a31515"&gt;"{73000449-0035-43ad-985F-A3071ECBC079}"&lt;/span&gt;;
        &lt;span style="color: #2b91af"&gt;Windows2 &lt;/span&gt;windows2 = (&lt;span style="color: #2b91af"&gt;Windows2&lt;/span&gt;)_applicationObject.Windows;
        &lt;span style="color: #2b91af"&gt;Assembly &lt;/span&gt;asm = &lt;span style="color: #2b91af"&gt;Assembly&lt;/span&gt;.GetExecutingAssembly();
        _toolWindow = windows2.CreateToolWindow2(_addInInstance, asm.Location,
            &lt;span style="color: #a31515"&gt;"MyAddin1.MyAddInToolWindow"&lt;/span&gt;,
            &lt;span style="color: #a31515"&gt;"MyAddin1"&lt;/span&gt;, guidString, &lt;span style="color: blue"&gt;ref &lt;/span&gt;programmableObject);
        _toolWindow.Visible = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
        _toolWindowControl = (&lt;span style="color: #2b91af"&gt;MyAddInToolWindow&lt;/span&gt;)_toolWindow.Object;
        &lt;span style="color: blue"&gt;#endregion
    &lt;/span&gt;}
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt; &lt;/pre&gt;

&lt;p&gt;After the creation of the tool window don’t forget to do _toolWindow.Visible = &lt;span style="color: blue"&gt;true&lt;/span&gt;; other wise the tool window might now show :)&lt;/p&gt;

&lt;p&gt;After this, just press run and test it. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Documents and Settings/prainho/Local Settings/Temp/WindowsLiveWriter-429641856/supfiles1B7A7828/image[71].png"&gt;&lt;img title="image_thumb[37]" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="307" alt="image_thumb[37]" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateaToolWindowinVisualStudio_F385/image_thumb%5B37%5D_ff5f9f47-229c-46a6-bc48-19a116dc47b8.png" width="445" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;And you can also dock the tool window.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Documents and Settings/prainho/Local Settings/Temp/WindowsLiveWriter-429641856/supfiles1B7A7828/image[75].png"&gt;&lt;img title="image_thumb[39]" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="315" alt="image_thumb[39]" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateaToolWindowinVisualStudio_F385/image_thumb%5B39%5D_ae9f61a7-293f-48fd-b096-ad99b0fbc292.png" width="456" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Now, if you close the tool window and then open it again the tool window will not show. You will need to change the method Exec and add the CreateToolWindow().&lt;/p&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/summary&amp;gt;
/// &amp;lt;param term='commandName'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;The name of the command to execute.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='executeOption'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Describes how the command should be run.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='varIn'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Parameters passed from the caller to the command handler.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='varOut'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Parameters passed from the command handler to the caller.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;param term='handled'&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;Informs the caller if the command was handled or not.&lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;seealso class='Exec' /&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;Exec(&lt;span style="color: blue"&gt;string &lt;/span&gt;commandName, &lt;span style="color: #2b91af"&gt;vsCommandExecOption &lt;/span&gt;executeOption, &lt;span style="color: blue"&gt;ref object &lt;/span&gt;varIn, &lt;span style="color: blue"&gt;ref object &lt;/span&gt;varOut, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;handled)
{
    handled = &lt;span style="color: blue"&gt;false&lt;/span&gt;;
    &lt;span style="color: blue"&gt;if&lt;/span&gt;(executeOption == &lt;span style="color: #2b91af"&gt;vsCommandExecOption&lt;/span&gt;.vsCommandExecOptionDoDefault)
    {
        &lt;span style="color: blue"&gt;if&lt;/span&gt;(commandName == &lt;span style="color: #a31515"&gt;"MyAddin1.Connect.MyAddin1"&lt;/span&gt;)
        {
            handled = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
            CreateToolWindow();
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Now test it and you can close and the open the tool window and you will have no problems.&lt;/p&gt;

&lt;p&gt;One other thing you can do Is show the icon in menu “View” instead of menu “Tools”, to do that just change the method OnConnection and where you have the string “Tools” just change it to “View” very simple :)&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Here is where the icon will appear after this change.&lt;/p&gt;

&lt;p&gt; &lt;a href="file:///C:/Documents and Settings/prainho/Local Settings/Temp/WindowsLiveWriter-429641856/supfiles1B7A7828/image[64].png"&gt;&lt;img title="image_thumb[34]" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="189" alt="image_thumb[34]" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateaToolWindowinVisualStudio_F385/image_thumb%5B34%5D_81faa65b-84e3-46d6-8656-a583571a2d05.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This is a very fast tutorial, there are other in the web that explains everything, one other choice is check &lt;a href="http://msdn.microsoft.com/en-us/default.aspx"&gt;MSDN&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/7589.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7589.aspx</guid>
            <pubDate>Tue, 21 Apr 2009 14:17:12 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/7589.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7589.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/7589.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to create an add-in in Visual Studio</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7588.aspx</link>
            <description>&lt;p&gt;Create Add-ins is very simple&lt;/p&gt;  &lt;p&gt;Create a project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="140" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_1.png" width="379" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Then select the project as a Visual Studio Add-in.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="311" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_2.png" width="432" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;And then follow the Wizard.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_8.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="333" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_3.png" width="436" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here you choose the language, I’m going to user C#.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_10.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="335" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_4.png" width="438" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here you choose where the add-in will work.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_12.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="335" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_5.png" width="438" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here you choose the add-in name and description.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_14.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="343" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_6.png" width="448" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here you choose how the add-in will work.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_16.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="349" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_7.png" width="457" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here you choose the information you want to show when you do Help/About in Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_18.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="343" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_8.png" width="449" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here is the final summary.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_20.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="346" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_9.png" width="453" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;And finally our add-in is created. Just press run and you will have a icon of the add-in in Visual Studio Tools menu.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_22.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="298" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/HowtocreateanaddininVisualStudio_ED36/image_thumb_10.png" width="316" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;As you can see it’s very simple to create an add-in, basically it’s just Next, next, next. &lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/7588.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7588.aspx</guid>
            <pubDate>Tue, 21 Apr 2009 13:54:17 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/7588.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/21/7588.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/7588.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Twitter API</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/15/7554.aspx</link>
            <description>&lt;p&gt;Recently, I join &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; after some pressure at home and at work :). But since I don’t like to publish my life there, I’m doing this, I’m doing that, bla bla bla, I decided to view &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; in a different perspective. I decided to view the &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; &lt;a href="http://apiwiki.twitter.com/"&gt;API&lt;/a&gt;. While I was watching the &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; &lt;a href="http://apiwiki.twitter.com/"&gt;API&lt;/a&gt; I discovered that there are lot’s of libraries that try to do a wrapper around the &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; &lt;a href="http://apiwiki.twitter.com/"&gt;API&lt;/a&gt;, including .Net libraries.&lt;/p&gt;  &lt;p&gt;One of the libraries I had recently looked and done some testes was &lt;a href="http://code.google.com/p/twitterizer/"&gt;Twitterizer&lt;/a&gt;. &lt;a href="http://code.google.com/p/twitterizer/"&gt;Twitterizer&lt;/a&gt; has a very easy interface BUT doesn’t support every Twitter method plus, the last version present in the site has some problems that raises and exception. (To solve this problem I had to dig into the issues and discovered there a zip will the working libraries)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;So Here is my sample application it’s intention was test almost every method.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Linq;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Text;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Twitterizer.Framework;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;TwitterSample
{
    &lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Program
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;static void &lt;/span&gt;Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)
        {
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Twitter&lt;/span&gt;.VerifyCredentials(&lt;span style="color: #a31515"&gt;"twitter_user"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"twitter_password"&lt;/span&gt;))
            {
                &lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Twitter&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"twitter_user"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"twitter_password"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"my_app"&lt;/span&gt;);

                PrintReplies(twitter);
                PrintFollowers(twitter);
                PrintFriends(twitter);
                PrintDirectMessages(twitter);
                PrintFriendsTimeline(twitter);
                PrintPublicTimeline(twitter);
                PrintUserTimeline(twitter);

                &lt;span style="color: green"&gt;//post a message
                &lt;/span&gt;twitter.Status.Update(&lt;span style="color: #a31515"&gt;"Testing 123, Testing"&lt;/span&gt;);
            }
            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ReadKey();
        }

        &lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TwitterUser &lt;/span&gt;GetUserInfo(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter, &lt;span style="color: blue"&gt;string &lt;/span&gt;userId)
        {
            &lt;span style="color: #2b91af"&gt;TwitterUser &lt;/span&gt;user = twitter.Status.Show(userId);

            &lt;span style="color: blue"&gt;return &lt;/span&gt;user;
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintReplies(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterStatusCollection &lt;/span&gt;col = twitter.Status.Replies();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Replies"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterStatus &lt;/span&gt;status &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Created:                " &lt;/span&gt;+ status.Created);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                     " &lt;/span&gt;+ status.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToStatusID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToUserID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsFavorited:            " &lt;/span&gt;+ status.IsFavorited);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsTruncated:            " &lt;/span&gt;+ status.IsTruncated);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"RecipientID:            " &lt;/span&gt;+ status.RecipientID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Source:                 " &lt;/span&gt;+ status.Source);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Text:                   " &lt;/span&gt;+ status.Text);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TwitterUser.ScreenName: " &lt;/span&gt;+ status.TwitterUser.ScreenName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintFollowers(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterUserCollection &lt;/span&gt;col = twitter.User.Followers();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Followers"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterUser &lt;/span&gt;user &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Description:       " &lt;/span&gt;+ user.Description);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Friends_count:     " &lt;/span&gt;+ user.Friends_count);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                " &lt;/span&gt;+ user.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsProtected:       " &lt;/span&gt;+ user.IsProtected);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Location:          " &lt;/span&gt;+ user.Location);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"NumberOfFollowers: " &lt;/span&gt;+ user.NumberOfFollowers);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ProfileImageUri:   " &lt;/span&gt;+ user.ProfileImageUri);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ProfileUri:        " &lt;/span&gt;+ user.ProfileUri);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ScreenName:        " &lt;/span&gt;+ user.ScreenName);
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(user.Status != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                {
                    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Status.Text:       " &lt;/span&gt;+ user.Status.Text);
                }
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TimeZone:          " &lt;/span&gt;+ user.TimeZone);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"UserName:          " &lt;/span&gt;+ user.UserName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintFriends(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterUserCollection &lt;/span&gt;col = twitter.User.Friends();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Friends"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterUser &lt;/span&gt;user &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Description:       " &lt;/span&gt;+ user.Description);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Friends_count:     " &lt;/span&gt;+ user.Friends_count);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                " &lt;/span&gt;+ user.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsProtected:       " &lt;/span&gt;+ user.IsProtected);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Location:          " &lt;/span&gt;+ user.Location);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"NumberOfFollowers: " &lt;/span&gt;+ user.NumberOfFollowers);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ProfileImageUri:   " &lt;/span&gt;+ user.ProfileImageUri);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ProfileUri:        " &lt;/span&gt;+ user.ProfileUri);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ScreenName:        " &lt;/span&gt;+ user.ScreenName);
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(user.Status != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                {
                    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Status.Text:       " &lt;/span&gt;+ user.Status.Text);
                }
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TimeZone:          " &lt;/span&gt;+ user.TimeZone);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"UserName:          " &lt;/span&gt;+ user.UserName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintDirectMessages(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterStatusCollection &lt;/span&gt;col = twitter.DirectMessages.DirectMessages();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"DirectMessages"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterStatus &lt;/span&gt;status &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Created:                " &lt;/span&gt;+ status.Created);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                     " &lt;/span&gt;+ status.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToStatusID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToUserID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsFavorited:            " &lt;/span&gt;+ status.IsFavorited);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsTruncated:            " &lt;/span&gt;+ status.IsTruncated);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"RecipientID:            " &lt;/span&gt;+ status.RecipientID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Source:                 " &lt;/span&gt;+ status.Source);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Text:                   " &lt;/span&gt;+ status.Text);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TwitterUser.ScreenName: " &lt;/span&gt;+ status.TwitterUser.ScreenName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintFriendsTimeline(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterStatusCollection &lt;/span&gt;col = twitter.Status.FriendsTimeline();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"FriendsTimeline"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterStatus &lt;/span&gt;status &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Created:                " &lt;/span&gt;+ status.Created);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                     " &lt;/span&gt;+ status.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToStatusID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToUserID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsFavorited:            " &lt;/span&gt;+ status.IsFavorited);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsTruncated:            " &lt;/span&gt;+ status.IsTruncated);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"RecipientID:            " &lt;/span&gt;+ status.RecipientID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Source:                 " &lt;/span&gt;+ status.Source);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Text:                   " &lt;/span&gt;+ status.Text);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TwitterUser.ScreenName: " &lt;/span&gt;+ status.TwitterUser.ScreenName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintPublicTimeline(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterStatusCollection &lt;/span&gt;col = twitter.Status.PublicTimeline();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"PublicTimeline"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterStatus &lt;/span&gt;status &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Created:                " &lt;/span&gt;+ status.Created);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                     " &lt;/span&gt;+ status.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToStatusID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToUserID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsFavorited:            " &lt;/span&gt;+ status.IsFavorited);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsTruncated:            " &lt;/span&gt;+ status.IsTruncated);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"RecipientID:            " &lt;/span&gt;+ status.RecipientID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Source:                 " &lt;/span&gt;+ status.Source);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Text:                   " &lt;/span&gt;+ status.Text);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TwitterUser.ScreenName: " &lt;/span&gt;+ status.TwitterUser.ScreenName);
            }
        }

        &lt;span style="color: blue"&gt;public static void &lt;/span&gt;PrintUserTimeline(&lt;span style="color: #2b91af"&gt;Twitter &lt;/span&gt;twitter)
        {
            &lt;span style="color: #2b91af"&gt;TwitterStatusCollection &lt;/span&gt;col = twitter.Status.UserTimeline();

            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"UserTimeline"&lt;/span&gt;);

            &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TwitterStatus &lt;/span&gt;status &lt;span style="color: blue"&gt;in &lt;/span&gt;col)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"------------------------------------------"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Created:                " &lt;/span&gt;+ status.Created);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"ID:                     " &lt;/span&gt;+ status.ID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToStatusID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"InReplyToStatusID:      " &lt;/span&gt;+ status.InReplyToUserID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsFavorited:            " &lt;/span&gt;+ status.IsFavorited);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"IsTruncated:            " &lt;/span&gt;+ status.IsTruncated);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"RecipientID:            " &lt;/span&gt;+ status.RecipientID);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Source:                 " &lt;/span&gt;+ status.Source);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Text:                   " &lt;/span&gt;+ status.Text);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"TwitterUser.ScreenName: " &lt;/span&gt;+ status.TwitterUser.ScreenName);
            }
        }
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some tests in this library I was disappointed because I wasn’t able to find the documentation and some other features that are supported by &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; are missing.&lt;/p&gt;

&lt;p&gt;Now when I’ve some free time I will do some tests to other library named &lt;a href="http://code.google.com/p/tweetsharp/"&gt;Tweet#&lt;/a&gt;, and from what I’ve seen it’s much more complete and it’s fluent.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;I’m doing this not only for fun, but to continue evolve and learn new things :) and if you saw this &lt;a href="http://agilior.pt/blogs/bruno.camara/archive/2009/04/15/7551.aspx"&gt;post&lt;/a&gt;, you know that this is Agilior culture. &lt;/p&gt;

&lt;p&gt;Learn and evolve, learn and evolve.&lt;/p&gt;

&lt;p&gt;So like I wrote, I’m learning a bit of Twitter because there are lots of client applications around &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; but I haven’t saw any add-in that Integrates with Visual Studio and since I know few things :) about how to develop extensions and software factories to Visual Studio I decided to start my &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; Add-in. I’m only in the beginning (testing libraries) but I will release more news soon. Also, I’m intend to create a series of posts to show how to create a VS add-in and in particular how I’m creating this &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; Add-in.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/7554.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/15/7554.aspx</guid>
            <pubDate>Wed, 15 Apr 2009 12:46:13 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/7554.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/04/15/7554.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/7554.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Load and unload assemblies</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/03/15/7328.aspx</link>
            <description>&lt;p&gt;Last week, I had a problem that probably some .Net developer had faced. The problem consists in load and unload an assembly?.&lt;/p&gt;  &lt;p&gt;Can I do that??? Well, I can’t do it in a simple way. One of the things that Assembly doesn’t support in unload, check this &lt;a href="http://blogs.msdn.com/jasonz/archive/2004/05/31/145105.aspx"&gt;post&lt;/a&gt; to see why. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;So, like I wrote, last week I was developing a new feature for a software factory and that feature consisted in get all references and do something else. &lt;/p&gt;  &lt;p&gt;My recipe does something like this:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Get project assembly &lt;/li&gt;    &lt;li&gt;Copy the assembly DLL to a location &lt;/li&gt;    &lt;li&gt;Get all assembly references &lt;/li&gt;    &lt;li&gt;Generate a file &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Do number 1 is simple.&lt;/p&gt;  &lt;p&gt;Do number 2 is also simple, but has a problem.&lt;/p&gt;  &lt;p&gt;Do number 3 is also simple, but has a problem.&lt;/p&gt;  &lt;p&gt;Do number 4 is simple.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I’m going to explain first problem number 3 then problem 2&lt;/p&gt;  &lt;p&gt;The problem with number 3 it’s because I load a assembly and they I get referenced assemblies. To get referenced assemblies I just do:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;Assembly &lt;/span&gt;assembly = &lt;span style="color: #2b91af"&gt;Assembly&lt;/span&gt;.LoadFrom(&lt;span style="color: #a31515"&gt;@"c:\myAssembly.dll"&lt;/span&gt;);
&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;[] references = assembly.GetReferencedAssemblies();&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This piece of code has a problem, since I’m loading the assembly and they get referenced assemblies the file myAssembly.dll is now locked this means that the next time I try to  run number 2 I will get an exception and the file will not ne copied. And this is why I had problem  number 2.&lt;/p&gt;

&lt;p&gt;Now, how can I load the assembly and then unload that assembly so the file won’t be locked???&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;I came across some solutions.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;One of the possible solutions is just copy the assembly to something unique like {GUID}.DLL and then load that {GUID}.DLL, and do everything I need to do, this way I won’t lock my file. 
    &lt;ol&gt;
      &lt;li&gt;Problem: I will have the assembly {GUID}.DLL loaded (in memory) every time, and can’t delete file {GUID}.DLL, because it’s locked. And finally I can’t unload unless I close Visual Studio. &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;

  &lt;li&gt;Why don’t I just load the assembly into an array of bytes and then load the assembly, like this: 
    &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;Assembly &lt;/span&gt;assembly = &lt;span style="color: #2b91af"&gt;Assembly&lt;/span&gt;.Load(&lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.ReadAllBytes(&lt;span style="color: #a31515"&gt;@"c:\myAssembly.dll"&lt;/span&gt;));&lt;/pre&gt;
    &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

    &lt;ol&gt;
      &lt;li&gt;Problem: I can do this and my file will not be locked but that array of bytes will be in memory and my visual studio memory will grow every time I run that recipe. That memory will be released only when I close the Visual Studio. &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;

  &lt;li&gt;I can load the assembly in a new AppDomain and then unload the AppDomain. 
    &lt;ol&gt;
      &lt;li&gt;Problem: tThis was a strange problem and I don’t know why but I load the assembly in a new AppDomain and that assembly become part of the new AppDomain and the AppDomain.Current. This was strange. Don’t know if I was doing something wrong. Now since the Assembly is loaded in AppDomain.Current I wasn’t able to copy the file, because it was locked. &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;

  &lt;li&gt;The last solution I came across to load the assembly and unload it. This solution Consists in create a new AppDomain and then use method DoCallBack: &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here it is the source code:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;AppDomainSetup &lt;/span&gt;setup = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;AppDomainSetup&lt;/span&gt;();
setup.ApplicationBase = ApplicationBasePath;

&lt;span style="color: #2b91af"&gt;AppDomain &lt;/span&gt;newDomainReferences = &lt;span style="color: #2b91af"&gt;AppDomain&lt;/span&gt;.CreateDomain(&lt;span style="color: #a31515"&gt;"AppDomain"&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;, setup);

CallBackAssemblyReferences call = &lt;span style="color: blue"&gt;new &lt;/span&gt;CallBackAssemblyReferences(newDomainReferences, filepath);
newDomainReferences.DoCallBack(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CrossAppDomainDelegate&lt;/span&gt;(call.LoadAssemblyReferences));
&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;[] assName = (&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;[])newDomainReferences.GetData(&lt;span style="color: #a31515"&gt;"AssemblyReferences"&lt;/span&gt;);

&lt;span style="color: #2b91af"&gt;AppDomain&lt;/span&gt;.Unload(newDomainReferences);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This solution enables me to do a callback in a different domain. My class CallBackAssemblyReferences just does this:&lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;Serializable&lt;/span&gt;]
&lt;span style="color: blue"&gt;internal class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CallBackAssemblyReferences
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;#region &lt;/span&gt;Members Variables
    &lt;span style="color: blue"&gt;private string &lt;/span&gt;assemblyFile;
    &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;AppDomain &lt;/span&gt;domain;
    &lt;span style="color: blue"&gt;#endregion

    #region &lt;/span&gt;Public Implementation
    &lt;span style="color: blue"&gt;public &lt;/span&gt;CallBackAssemblyReferences()
    {

    }
    &lt;span style="color: blue"&gt;public &lt;/span&gt;CallBackAssemblyReferences(&lt;span style="color: #2b91af"&gt;AppDomain &lt;/span&gt;domain, &lt;span style="color: blue"&gt;string &lt;/span&gt;assemblyFile)
    {
        &lt;span style="color: blue"&gt;this&lt;/span&gt;.assemblyFile = assemblyFile;
        &lt;span style="color: blue"&gt;this&lt;/span&gt;.domain = domain;
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;LoadAssemblyReferences()
    {
        &lt;span style="color: #2b91af"&gt;Assembly &lt;/span&gt;assembly = &lt;span style="color: blue"&gt;this&lt;/span&gt;.domain.Load(&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;.GetAssemblyName(&lt;span style="color: blue"&gt;this&lt;/span&gt;.assemblyFile));

        domain.SetData(&lt;span style="color: #a31515"&gt;"AssemblyReferences"&lt;/span&gt;, assembly.GetReferencedAssemblies());
    }
    &lt;span style="color: blue"&gt;#endregion
&lt;/span&gt;}&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This class has a constructor that receives the new domain I’m working on and the path to the assembly I want to load. &lt;/p&gt;

&lt;p&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;CallBackAssemblyReferences(&lt;span style="color: #2b91af"&gt;AppDomain &lt;/span&gt;domain, &lt;span style="color: blue"&gt;string &lt;/span&gt;assemblyFile) &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Then I just have my callback method WITH NO PARAMETERS. &lt;/p&gt;

&lt;p&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;LoadAssemblyReferences() &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This is the method that will be called when I do &lt;/p&gt;

&lt;p&gt;newDomainReferences.DoCallBack(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CrossAppDomainDelegate&lt;/span&gt;(call.LoadAssemblyReferences)); &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The callback method only loads the assembly in the new domain and then sets data in the new domain. These data are the assembly references. &lt;/p&gt;

&lt;p&gt;When the DoCallBack returns I just had to do &lt;/p&gt;

&lt;p&gt;&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;[] assName = (&lt;span style="color: #2b91af"&gt;AssemblyName&lt;/span&gt;[])newDomainReferences.GetData(&lt;span style="color: #a31515"&gt;"AssemblyReferences"&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;To get the references I had saved. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Finally I just unload the AppDomain. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Now I can run my recipe every time I need without lock the file and without decrease visual studio performance.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/7328.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/03/15/7328.aspx</guid>
            <pubDate>Sun, 15 Mar 2009 17:59:14 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/7328.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/03/15/7328.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/7328.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Software Factory &amp;ndash; Guidance Migration from Visual Studio 2005 to Visual Studio 2008</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/06/6880.aspx</link>
            <description>&lt;p&gt;Before begin I have to give some credit to my friend &lt;a href="http://www.agilior.pt/blogs/rodrigo.guerreiro"&gt;Rodrigo Guerreiro&lt;/a&gt; because he helped me with this PROBLEM.&lt;/p&gt;
&lt;p&gt;First I can say that I wasn’t able to find ANY information in internet about migration. Don’t know if I was looking in the wrong sites but i wasn’t able to find any information.&lt;/p&gt;
&lt;p&gt;Now this post reflect what I did in order to create 2 MSI’s files that can be installed in Visual Studio 2005 and Visual Studio 2008. (One MSI to install in VS2005 and another to install in VS2008)&lt;/p&gt;
&lt;p&gt;Notice that I didn’t had to migrate my solution to VS2008 in order to create a MSI that installs a factory in VS2008&lt;/p&gt;
&lt;p&gt;These was my steps:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Go to the solution folder and, in my case, there was a folder with the project setup. What I did was copy that folder and rename it from XXXSetup to XXXSetup2008.
    &lt;ol&gt;
        &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_2.png"&gt;&lt;img height="42" border="0" width="180" title="image" style="border-width: 0px; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_thumb.png" /&gt;&lt;/a&gt; &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Inside the folder XXXSetup2008 I rename the file XXXSetup.vdproj to XXXSetup2008.vdproj
    &lt;ol&gt;
        &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_4.png"&gt;&lt;img height="24" border="0" width="244" title="image" style="border-width: 0px; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Then I edit file XXXSetup2008.vdproj (With notepad :)) and every place I had XXXSetup I rename it to XXXsetup2008 (Very Careful with this point because you can mess up with the project and start from the begining). In my case I just had to do this renames:
    &lt;ol&gt;
        &lt;li&gt;"ProjectName" = "8:XXXSetup" para "ProjectName" = "8:XXXSetup2008" &lt;/li&gt;
        &lt;li&gt;"OutputFilename" = "8:Release\\XXXSetup.msi" para "OutputFilename" = "8:Release\\XXXSetup2008.msi" &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;After this I open the solution in VS2005 and added the project XXXSetup2008.vdproj to my solution
    &lt;ol&gt;
        &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_6.png"&gt;&lt;img height="39" border="0" width="190" title="image" style="border-width: 0px; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_thumb_2.png" /&gt;&lt;/a&gt;  &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;With the project XXXSetup2008 selected.
    &lt;ol&gt;
        &lt;li&gt;In the solution explorer choose “Custom Actions Editor” icon
        &lt;ol&gt;
            &lt;li&gt;A window will open with the following custom actions              &lt;br /&gt;
            -- GuidancePackage[Install], [commit], [roolback], [uninstall]               &lt;br /&gt;
            &lt;br /&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_8.png"&gt;&lt;img height="436" border="0" width="850" title="image" style="border-width: 0px; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image_thumb_3.png" /&gt;&lt;/a&gt;  &lt;br /&gt;
            &lt;/li&gt;
            &lt;li&gt;Click in every single one and on the properties window change it from /Hive=8.0 /Configuration="[TARGETDIR]xxx.xml" to /Hive=9.0 /Configuration="[TARGETDIR]xxx.xml"              &lt;br /&gt;
            &lt;br /&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image15.png"&gt;&lt;img height="436" border="0" width="846" title="image" style="border: 0px none ; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image15_thumb.png" /&gt;&lt;/a&gt;               &lt;br /&gt;
            &lt;br /&gt;
            &lt;/li&gt;
        &lt;/ol&gt;
        &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Again with the project XXXSetup2008 selected
    &lt;ol&gt;
        &lt;li&gt;In the solution explorer choose “Launch Conditions Editor” icon &lt;/li&gt;
        &lt;li&gt;A window will open with the following Launch Conditions:
        &lt;ol&gt;
            &lt;li&gt;Search Target Machine &lt;/li&gt;
            &lt;li&gt;Launch Conditions &lt;/li&gt;
        &lt;/ol&gt;
        &lt;/li&gt;
        &lt;li&gt;click in every single option (CSharp, RunTime, VS, .NetFramework, C# Language, Guidance Automation Extensions, VS.Net) and in the properties you will have to change every single place you have 8 (VS2005) change it to 9 (VS2008).          &lt;br /&gt;
        &lt;br /&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image20.png"&gt;&lt;img height="451" border="0" width="876" title="image" style="border: 0px none ; display: inline;" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/pedro.rainho/WindowsLiveWriter/SoftwareFactoryGuidanceMigrationfromVisu_F4DB/image20_thumb.png" /&gt;&lt;/a&gt;  &lt;br /&gt;
        &lt;br /&gt;
        &lt;/li&gt;
        &lt;li&gt;Here it is what you need to change:
        &lt;ol&gt;
            &lt;li&gt;In CSharp change it from:              &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\8.0\InstalledProducts\Microsoft Visual C#               &lt;br /&gt;
            To:               &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\9.0\InstalledProducts\Microsoft Visual C# &lt;/li&gt;
            &lt;li&gt;In RunTime change it from:              &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\8.0\InstalledProducts\RecipeManagerPackage               &lt;br /&gt;
            To:               &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\9.0\InstalledProducts\RecipeManagerPackage &lt;/li&gt;
            &lt;li&gt;In VS.Net change it from:              &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS               &lt;br /&gt;
            To:               &lt;br /&gt;
              SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS &lt;/li&gt;
            &lt;li&gt;In VS.Net change it from::              &lt;br /&gt;
              Visual Studio .NET 8.0 is not installed. Do you want to see information of the product? Click Yes to be directed to a web page, click No to exit.               &lt;br /&gt;
            To:               &lt;br /&gt;
              Visual Studio .NET 9.0 is not installed. Do you want to see information of the product? Click Yes to be directed to a web page, click No to exit. &lt;/li&gt;
        &lt;/ol&gt;
        &lt;/li&gt;
    &lt;/ol&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now Compile and create the MSI’s. The next step is test the Factory in a VS 2008 :) Hope I was able to help. Sure helped me.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/6880.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/06/6880.aspx</guid>
            <pubDate>Fri, 06 Feb 2009 09:28:32 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/6880.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/06/6880.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/6880.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to get all projects that exists in a Visual Studio Solution</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6872.aspx</link>
            <description>&lt;p&gt;Recently during a software factory development I had a problem, how can I get all projects that exists in a visual studio solution. &lt;/p&gt;
&lt;p&gt;The only solution that I found was this:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public static &lt;/span&gt;Project[] GetAllSolutionProjects(Solution solution)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(solution == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue;"&gt;return null&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;Project&amp;gt; solutionProjects = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;Project&amp;gt;();&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue;"&gt;foreach &lt;/span&gt;(Project project &lt;span style="color: blue;"&gt;in &lt;/span&gt;solution.Projects)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(project.Object &lt;span style="color: blue;"&gt;is &lt;/span&gt;Project)&lt;br /&gt;        {&lt;br /&gt;            solutionProjects.Add(project.Object &lt;span style="color: blue;"&gt;as &lt;/span&gt;Project);&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: blue;"&gt;else&lt;br /&gt;        &lt;/span&gt;{&lt;br /&gt;            Project[] projects = GetAllVsProjects(project.ProjectItems);&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(projects != &lt;span style="color: blue;"&gt;null &lt;/span&gt;&amp;amp;&amp;amp; projects.Length &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                solutionProjects.AddRange(projects);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;solutionProjects.ToArray();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;private static &lt;/span&gt;Project[] GetAllVsProjects(ProjectItems items)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;if &lt;/span&gt;(items == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue;"&gt;return null&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;Project&amp;gt; solutionProjects = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;Project&amp;gt;();&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue;"&gt;foreach &lt;/span&gt;(ProjectItem item &lt;span style="color: blue;"&gt;in &lt;/span&gt;items)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(IsProject(item.Kind))&lt;br /&gt;        {&lt;br /&gt;            solutionProjects.Add(item.Object &lt;span style="color: blue;"&gt;as &lt;/span&gt;Project);&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: blue;"&gt;else if &lt;/span&gt;(item.SubProject != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(IsProject(item.SubProject.Kind))&lt;br /&gt;            {&lt;br /&gt;                solutionProjects.Add(item.SubProject &lt;span style="color: blue;"&gt;as &lt;/span&gt;Project);&lt;br /&gt;            }&lt;br /&gt;            &lt;span style="color: blue;"&gt;else&lt;br /&gt;            &lt;/span&gt;{&lt;br /&gt;                Project[] subprojects = GetAllVsProjects(item.SubProject.ProjectItems);&lt;br /&gt;&lt;br /&gt;                &lt;span style="color: blue;"&gt;if &lt;/span&gt;(subprojects != &lt;span style="color: blue;"&gt;null &lt;/span&gt;&amp;amp;&amp;amp; subprojects.Length &amp;gt; 0)&lt;br /&gt;                {&lt;br /&gt;                    solutionProjects.AddRange(subprojects);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: blue;"&gt;else&lt;br /&gt;        &lt;/span&gt;{&lt;br /&gt;            Project[] projects = GetAllVsProjects(item.ProjectItems);&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: blue;"&gt;if &lt;/span&gt;(projects != &lt;span style="color: blue;"&gt;null &lt;/span&gt;&amp;amp;&amp;amp; projects.Length &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                solutionProjects.AddRange(projects);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;solutionProjects.ToArray();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: green;"&gt;//Visual Basic {F184B08F-C81C-45F6-A57F-5ABD9991F28F}&lt;br /&gt;    //Visual C# {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;br /&gt;    //Visual C++ {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&lt;br /&gt;    //Visual J# {E6FDF86B-F3D1-11D4-8576-0002A516ECE8}&lt;br /&gt;    //Web Project {E24C65DC-7377-472b-9ABA-BC803B73C61A}&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;return &lt;/span&gt;IsWebProject(projectKind) || &lt;br /&gt;        IsVisualJSharpProject(projectKind) || &lt;br /&gt;        IsVisualCPlusPlusProject(projectKind) ||&lt;br /&gt;        IsVisualCSharpProject(projectKind) ||&lt;br /&gt;        IsVisualBasicProject(projectKind);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsProject(&lt;span style="color: blue;"&gt;string &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;if&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(projectKind))&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue;"&gt;return false&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;IsProject(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(projectKind));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsWebProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;projectKind.CompareTo(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"{E24C65DC-7377-472b-9ABA-BC803B73C61A}"&lt;/span&gt;)) == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsVisualJSharpProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;projectKind.CompareTo(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}"&lt;/span&gt;)) == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsVisualCPlusPlusProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;projectKind.CompareTo(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"&lt;/span&gt;)) == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsVisualCSharpProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;projectKind.CompareTo(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"&lt;/span&gt;)) == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public static bool &lt;/span&gt;IsVisualBasicProject(&lt;span style="color: rgb(43, 145, 175);"&gt;Guid &lt;/span&gt;projectKind)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue;"&gt;return &lt;/span&gt;projectKind.CompareTo(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"&lt;/span&gt;)) == 0;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Can any one tell me if is there a simple solution to get all projects in a VS solution, because this seems to me too much code just to get all projects. Is there another way???&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The projects I want are: Visual Basic, Visual C#, Visual C++, Visual J# and Web Project. I was only able to do this watching to the project kind property. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Is there another way???&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/6872.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6872.aspx</guid>
            <pubDate>Thu, 05 Feb 2009 12:36:40 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/6872.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6872.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/6872.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Get the assembly name from VS project</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6871.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here is how to get the assembly name from a project&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;  public static string &lt;/span&gt;GetProjectAssemblyName(Project project)&lt;br /&gt;  {&lt;br /&gt;     &lt;span style="color: blue;"&gt;return &lt;/span&gt;project.Properties.Item(&lt;span style="color: rgb(163, 21, 21);"&gt;"AssemblyName"&lt;/span&gt;).Value.ToString();         &lt;/pre&gt;
&lt;pre class="code"&gt;  }&lt;/pre&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/6871.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6871.aspx</guid>
            <pubDate>Thu, 05 Feb 2009 12:30:48 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/6871.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/02/05/6871.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/6871.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Manual guidance uninstall</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/21/6754.aspx</link>
            <description>&lt;p&gt;if for some reason during GAX uninstall you get a error saying that you need to uninstall all guidance's before you uninstall GAX try open this file C:\Documents and Settings\All Users\Application Data\Microsoft\Recipe Framework\RecipeFramework.xml and manually remove the guidance elements present in this file. After you manually remove the elements you are able to uninstall GAX.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/6754.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/21/6754.aspx</guid>
            <pubDate>Wed, 21 Jan 2009 07:29:38 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/6754.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/21/6754.aspx#feedback</comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/6754.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>