<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Hitchhiker guide to enterprise development</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/davidhernandez/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/davidhernandez/feed.xml</link>
    <description>Anything related to enterprise development. Mainly about SQL server, Biztalk, .Net, patterns&amp;amp;practices, SOA and TDD.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:00:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows Activation error 0x8007232A DNS Server failure</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/windows-activation-error-0x8007232a-dns-server-failure</link>
      <pubDate>Fri, 25 Feb 2011 09:22:09 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2011/02/25/windows-activation-error-0x8007232a-dns-server-failure/</guid>
      <description><![CDATA[I have encountered this error many times:  A problem occurred when Windows tried to activate. Error...]]></description>
      <content:encoded><![CDATA[<p>I have encountered this error many times:</p>  <p>A problem occurred when Windows tried to activate. Error Code 0x8007232A “DNS Server Failure”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/70/56/metablogapi/6786.image_554E4C13.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-70-56-metablogapi/6786.image_5F00_554E4C13.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/70/56/metablogapi/7128.image_thumb_1DD81518.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-70-56-metablogapi/7128.image_5F00_thumb_5F00_1DD81518.png" width="499" height="422" /></a></p>  <p>Activations errors are explained in the page: <a title="https://support.microsoft.com/kb/938450" href="https://support.microsoft.com/kb/938450">https://support.microsoft.com/kb/938450</a></p>  <p>It seems that the machine cannot locate a KMS server (or in my case that the server has been installed with a “wrong” product key) If you have MSDN subscription you can workaround this problem by setting the product key with this command line:</p>  <p>&#160;</p>  <p>slmgr –ipk &lt;Product-key&gt; (e.g. slmgr -ipk J3X3X-XY3XX-XX3XX-3XXXX-XX3XX)</p>  <p>And then activate the key in the “Control Panel\System and Security\System”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/70/56/metablogapi/4478.image_406C2DC6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-70-56-metablogapi/4478.image_5F00_406C2DC6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/70/56/metablogapi/6710.image_thumb_48A0535D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-70-56-metablogapi/6710.image_5F00_thumb_5F00_48A0535D.png" width="405" height="342" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Error when adding roles or features in Windows Server 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/error-when-adding-roles-or-features-in-windows-server-2008</link>
      <pubDate>Tue, 09 Jun 2009 03:03:11 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2009/06/09/error-when-adding-roles-or-features-in-windows-server-2008/</guid>
      <description><![CDATA[I wanted to add a new feature in my Windows Server 2008 but had problems when viewing the server...]]></description>
      <content:encoded><![CDATA[<p>I wanted to add a new feature in my Windows Server 2008 but had problems when viewing the server management console:</p> <p>&nbsp;</p> <p>"Server Manager encountered an unexpected error while collecting data about the status of this computer" when clicking in the detail link it said something like </p> <p>"Cannot open an anonymous level security token. (Exception from HRESULT: 0x80070543)"</p> <p>&nbsp;</p> <p>I have encountered this error a couple of times . I guess it is some configuration it gets changed when installing some products.</p> <p>&nbsp;</p> <p>I tried many diagnostic tools and un/reinstalling some KB hotfixes that some forums recommended, I also installed the SP2 but at the end the solution was simpler (at least for my case) (extracted from <a title="https://social.technet.microsoft.com/Forums/en-US/winservermanager/thread/f80a52fc-b022-4dd4-af35-621f1e7fe67c/#page:1" href="https://social.technet.microsoft.com/Forums/en-US/winservermanager/thread/f80a52fc-b022-4dd4-af35-621f1e7fe67c/#page:1">https://social.technet.microsoft.com/Forums/en-US/winservermanager/thread/f80a52fc-b022-4dd4-af35-621f1e7fe67c/#page:1</a>): </p> <p>&nbsp;</p> <p>From an elevated* cmd window run: <p>Dcomcnfg.exe <p>*Or click through the UAC prompt <p>2. Choose ComponentServices-&gt;Computers-&gt;My Computer.  <p>3. Choose Properties from the context menu.  <p>4. Choose the Default Properties tab.  <p>5. Select Connect in the Default Authentication Level drop down list if it is set to None. Choose OK, confirm selection in popup and close dcomcnfg.exe. <p>6. If the authentication level is not set to None, don't change it, since it may have been set by something else (such as an Admin).  <p>&nbsp;</p> <p>&nbsp;</p> <p>Regards,</p> <p>David</p>]]></content:encoded>
    </item>
    <item>
      <title>Enterprise Library 5.0 is being cooked! Make your suggestions.</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/enterprise-library-5-0-is-being-cooked-make-your-suggestions</link>
      <pubDate>Wed, 28 Jan 2009 17:11:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2009/01/28/enterprise-library-5-0-is-being-cooked-make-your-suggestions/</guid>
      <description><![CDATA[Enterprise Library 5.0 is&nbsp;being planned, if you want to "be part" of the planning team you can...]]></description>
      <content:encoded><![CDATA[<P>Enterprise Library 5.0 is&nbsp;being planned, if you want to "be part" of the planning team you can do it!</P>
<P>I've already seen&nbsp;the 100$&nbsp;formula in other projects and I really like it.<BR>To spend your virtual 100$ go to <A title="Grigori's blog" href="https://blogs.msdn.com/agile/archive/2009/01/26/enterprise-library-5-what-s-on-your-wish-list.aspx" target=_blank mce_href="https://blogs.msdn.com/agile/archive/2009/01/26/enterprise-library-5-what-s-on-your-wish-list.aspx">Grigori's blog</A>.</P>
<P>Here are my 100$</P>
<P>20$ Make possible to have a centralized configurations for many applications. (Now you can do it but all the logs are written into the same file, the event log end up in the same source) The desired effect would be to have a central configuration file but each application have a unique event log source, each application have a log file...<BR>30$ Make easier and document&nbsp;how&nbsp;to extend the application block. The GAT/GAX&nbsp;addins are great to create new AB and some providers. But if you want to Add/remove some of the functionality you need to code some not documented&nbsp;methods/classes and debug the code to see how EntLib works under the hood.<BR>30$ Policy Injecton AB. Enhance the non-intrusive injection. Implement an interface or deriving from MarshalByRefObject is very restricitive.Maybe Dynamic types can help here...<BR>20$ Make Data Access AB compatible with Entity Framework.<BR></P>]]></content:encoded>
    </item>
    <item>
      <title>Windows Vista Ultimate Update (Tinker)</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/windows-vista-ultimate-update-tinker</link>
      <pubDate>Sun, 09 Nov 2008 14:39:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/11/09/windows-vista-ultimate-update-tinker/</guid>
      <description><![CDATA[There is a new game included in one of the latest Vista Ultimate Update. It is a puzzle game that is...]]></description>
      <content:encoded><![CDATA[<P>There is a new game included in one of the latest Vista Ultimate Update. It is a puzzle game that is really addictive.</P>
<P>You can also record a video, within the game...</P><EMBED id=m5nsnu35 height=364 type=application/x-shockwave-flash pluginspage=https://macromedia.com/go/getflashplayer width=432 src=https://images.video.msn.com/flash/soapbox1_1.swf flashvars="c=v&amp;v=c46b9166-3046-4151-8210-9eb20a6d23f6&amp;ifs=true&amp;fr=msnvideo&amp;mkt=en-US" allowScriptAccess="always" allowFullScreen="true" mce_src="https://images.video.msn.com/flash/soapbox1_1.swf"></EMBED><NOEMBED></NOEMBED>]]></content:encoded>
    </item>
    <item>
      <title>4 hours with Silverlight (and Hosting)</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/4-hours-with-silverlight-and-hosting</link>
      <pubDate>Wed, 05 Nov 2008 16:37:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/11/05/4-hours-with-silverlight-and-hosting/</guid>
      <description><![CDATA[After watching some of the great tutorial videos in Silverlight.net I decided to play a little...]]></description>
      <content:encoded><![CDATA[<P>After watching some of the great tutorial videos in <A href="https://silverlight.net/Learn/videocat.aspx?cat=10" mce_href="https://silverlight.net/Learn/videocat.aspx?cat=10">Silverlight.net</A> I decided to play a little bit&nbsp;with Silverlight 2 and VS2008.</P>
<P>It is incredible all the funcionality that offers Silverlight with a plugin of 4.5 MB (WCF, Drawing, DataBinding, Linq ....) But what is even more incredible is the productivity you get right from the beggining.&nbsp;A .Net programmer doesn't have a deep learning curve and can accomplish many tasks within minutes.</P>
<P>The first Silverlight component I decided to do was a simple rotator (I know there are tons of them and very good ones) but I wanted to do my own and make it configurable so I could set the images by using the InitParameters. All of the things I needed to know where on the video tutorials. </P>
<P>The only glitch was finding a free hosting site to make my silverlight component public. Some hosting sites are not prepared to host Silverlight, why? Since Silverlight is just a .xap file that gets downloaded to the client and the plugins executes it. Theoretically you only need a web server to host a file and an html/php/asp.net (you name it) file to embed the SL control. Well, the problem is the xap extension, some hosting sites ban any "unkown" extension, and some doesn't have configured the MIME type for it. Therefore you end up thinking that the hosting site cannot host SL2 or that SL2 sucks. Read on ...</P>
<P>There is a codeplex article about writing an httphandler to bypass the hosting "type check" <A href="https://www.codeproject.com/KB/silverlight/XamlWithoutMime.aspx">https://www.codeproject.com/KB/silverlight/XamlWithoutMime.aspx</A>&nbsp;but of course this will only work in asp.net enabled sites.Read on ...</P>
<P>Well some people think a .xap file is&nbsp;some obscure&nbsp;binary file that only MS can understand, but in many places it is said that a .xap file is just a zip file that contains two files (a xaml manifest and a dll assembly) zip file??? What if I rename the xap file into zip, change the html code to tell that my SL2 control is in a zip file and then I upload it to a "Silverlight not prepared" hosting site. IT WORKS. Here is the proof!</P>
<P><A href="https://www.geocities.com/dhdiez/PhotoRotatorTestPage5.html">https://www.geocities.com/dhdiez/PhotoRotatorTestPage5.html</A></P>
<P><IFRAME height=650 src="https://www.geocities.com/dhdiez/PhotoRotatorTestPage5.html" width=720>

<p mce_keep="true" mce_keep="true">&nbsp</p>


<p mce_keep="true" mce_keep="true">&nbsp</p>

</IFRAME></P>
<P mce_keep="true">&nbsp;</P>
<P>The html code to host the app is here:</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>body</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>&lt;!-- Runtime errors from Silverlight will be displayed here.</P>
<P>This will contain debugging information and should be removed or hidden when debugging is completed --&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>div</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>id</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>='errorLocation'</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>style</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="</FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>font-size</FONT></FONT><FONT size=2>: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>small</FONT></FONT><FONT size=2>;</FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>color</FONT></FONT><FONT size=2>: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Gray</FONT></FONT><FONT size=2>;</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>"&gt;&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>div</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>div</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>id</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="silverlightControlHost"&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>object</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>data</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="data:application/x-silverlight-2,"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>type</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="application/x-silverlight-2"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>width</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="100%"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>height</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="100%"&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="initparams"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="imagen1=https://www.geocities.com/dhdiez/images/rw1.jpg,</P>
<P>imagen2=https://www.geocities.com/dhdiez/images/rw2.jpg,</P>
<P>imagen3=https://www.geocities.com/dhdiez/images/rw3.jpg,</P>
<P>imagen4=https://www.geocities.com/dhdiez/images/rw4.jpg,</P>
<P>imagen5=https://www.geocities.com/dhdiez/images/rw5.jpg,</P>
<P>imagen6=https://www.geocities.com/dhdiez/images/rw6.jpg,</P>
<P>imagen7=https://www.geocities.com/dhdiez/images/rw7.jpg,</P>
<P>imagen8=https://www.geocities.com/dhdiez/images/rw8.jpg,</P>
<P>imagen9=https://www.geocities.com/dhdiez/images/rw9.jpg,</P>
<P>imagen10=https://www.geocities.com/dhdiez/images/rw10.jpg,</P>
<P>imagen11=https://www.geocities.com/dhdiez/images/rw11.jpg,</P>
<P>imagen12=https://www.geocities.com/dhdiez/images/rw12.jpg,</P>
<P>imagen13=https://www.geocities.com/dhdiez/images/rw13.jpg,</P>
<P>imagen14=https://www.geocities.com/dhdiez/images/rw14.jpg,</P>
<P>imagen15=https://www.geocities.com/dhdiez/images/rw15.jpg,</P>
<P>imagen16=https://www.geocities.com/dhdiez/images/rw16.jpg"</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="source"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="<STRONG>ClientBin/PhotoRotator.zip</STRONG>"/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="onerror"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="onSilverlightError"</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="background"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="white"</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="minRuntimeVersion"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="2.0.31005.0"</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>param</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>name</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="autoUpgrade"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>value</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="true"</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>a</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>href</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="https://go.microsoft.com/fwlink/?LinkID=124807"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>style</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="</FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>text-decoration</FONT></FONT><FONT size=2>: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>none</FONT></FONT><FONT size=2>;</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>"&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>img</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>src</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="https://go.microsoft.com/fwlink/?LinkId=108181"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>alt</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="Get Microsoft Silverlight"</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>style</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>="</FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>border-style</FONT></FONT><FONT size=2>: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>none"/&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>a</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>object</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>iframe</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>style</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>='</FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>visibility</FONT></FONT><FONT size=2>:</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>hidden</FONT></FONT><FONT size=2>;</FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>height</FONT></FONT><FONT size=2>:</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>0</FONT></FONT><FONT size=2>;</FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>width</FONT></FONT><FONT size=2>:</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>0</FONT></FONT><FONT size=2>;</FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>border</FONT></FONT><FONT size=2>:</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>0px'&gt;&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>iframe</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>div</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P>
<P>&lt;/</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>body</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&gt;</P></FONT></FONT>]]></content:encoded>
    </item>
    <item>
      <title>PDC videos</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/pdc-videos</link>
      <pubDate>Tue, 04 Nov 2008 10:28:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/11/04/pdc-videos/</guid>
      <description><![CDATA[Here are the videos of the PDC. Just the week after the end of the PDC we can see all the...]]></description>
      <content:encoded><![CDATA[<P>Here are the videos of the PDC. Just the week after the end of the PDC we can see all the presentations of the PDC that shows us present and future of Microsoft Development.</P>
<P><A href="https://channel9.msdn.com/pdc2008/">https://channel9.msdn.com/pdc2008/</A></P>
<P>Here we can see the presentation of Windows Azure, Windows 7, Visual Studio 10, Team Foundation, Silverlight, C# 4.0, Office 14, Live services, Paralell Computing Platform ...<BR></P>]]></content:encoded>
    </item>
    <item>
      <title>It's the End for Windows 3.11!!</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/its-the-end-for-windows-3-11</link>
      <pubDate>Fri, 11 Jul 2008 05:50:33 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/07/11/its-the-end-for-windows-3-11/</guid>
      <description><![CDATA[Many people has echoed the news about extending the life of OEM Windows XP.  But there is not much...]]></description>
      <content:encoded><![CDATA[<p>Many people has echoed the news about extending the life of OEM Windows XP.</p>  <p>But there is not much fuss about that Windows 3.11 is going to be discontinued in embedded in 3 months (November 1st 2008) ... 16 years after its release!</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jcoyne/WindowsLiveWriter/ItstheEndfor3.11_8E6D/win311logo_2.gif" original-url="https://blogs.msdn.com/blogfiles/jcoyne/WindowsLiveWriter/ItstheEndfor3.11_8E6D/win311logo_2.gif"><img height="252" alt="win311logo" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jcoyne/WindowsLiveWriter/ItstheEndfor3.11_8E6D/win311logo_thumb.gif" original-url="https://blogs.msdn.com/blogfiles/jcoyne/WindowsLiveWriter/ItstheEndfor3.11_8E6D/win311logo_thumb.gif" width="211" border="0" /></a>&#160;</p>  <p><a href="https://blogs.msdn.com/jcoyne/archive/2008/07/09/it-s-the-end-for-3-11.aspx">John Coyne's Embedded Blog : It's the End for 3.11!!</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Web References in Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/web-references-in-visual-studio-2008</link>
      <pubDate>Wed, 11 Jun 2008 17:45:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/06/11/web-references-in-visual-studio-2008/</guid>
      <description><![CDATA[Some guys has asked about what happened to the Web References in Visual Studio 2008.  Well if we pay...]]></description>
      <content:encoded><![CDATA[<p>Some guys has asked about what happened to the Web References in Visual Studio 2008.</p>  <p>Well if we pay a little bit of attention, by default in VS2008 there is no right button over the project -&gt; &quot;Add Web Reference&quot;. There is a &quot;Add Service Reference&quot; (without Web) that means it is using a Reference to a service no matter which protocol is using (This is something not enough stressed a Service doesn't imply to be a web service).</p>  <p> This Service Reference is in fact a WCF proxy (if we look to the .config file we can see that after adding a Service Reference&#160; can see a section called system.serviceModel, bindings and so on.</p>  <p>If we need to create a classic &quot;old style&quot; web reference we still have the option to do so ... just look at this 50&quot; video.... </p>  <p>&#160;</p>  <p>(In order to see a high-res video check SkyDrive: <a title="https://cid-ae1cb866e9c0b985.skydrive.live.com/self.aspx/Public/Classic-Web-Services-In-Visual-Studio-2008.wmv" href="https://cid-ae1cb866e9c0b985.skydrive.live.com/self.aspx/Public/Classic-Web-Services-In-Visual-Studio-2008.wmv">https://cid-ae1cb866e9c0b985.skydrive.live.com/self.aspx/Public/Classic-Web-Services-In-Visual-Studio-2008.wmv</a>)</p>  <p><embed pluginspage="https://macromedia.com/go/getflashplayer" src="https://images.video.msn.com/flash/soapbox1_1.swf" width="432" height="364" type="application/x-shockwave-flash" mce_src="https://images.video.msn.com/flash/soapbox1_1.swf" quality="high" base="https://images.video.msn.com" allowfullscreen="true" allowscriptaccess="always" flashvars="c=v&amp;v=e172fdeb-73fc-4b28-8edc-294c81066aa9&amp;ifs=true&amp;fr=msnvideo&amp;mkt=en-AU&amp;brand=ninemsn" />    <br /><a title="Classic Web Services Reference in Visual Studio 2008" href="https://video.msn.com/video.aspx?vid=e172fdeb-73fc-4b28-8edc-294c81066aa9" target="_new" mce_href="https://video.msn.com/video.aspx?vid=e172fdeb-73fc-4b28-8edc-294c81066aa9">Video: Classic Web Services Reference in Visual Studio 2008</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Strong Naming Guidance Application Block for Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/strong-naming-guidance-application-block-for-visual-studio-2008</link>
      <pubDate>Fri, 23 May 2008 08:14:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2008/05/23/strong-naming-guidance-application-block-for-visual-studio-2008/</guid>
      <description><![CDATA[Enterprise Library 4.0 has been released and the Strong Naming Guidance Application Block has been...]]></description>
      <content:encoded><![CDATA[<P>Enterprise Library 4.0 has been <A href="https://msdn.microsoft.com/en-us/library/cc512464.aspx" target=_blank mce_href="https://msdn.microsoft.com/en-us/library/cc512464.aspx">released</A> and the Strong Naming Guidance Application Block has been removed from the EntLib, but it is available as a separate download in <A href="https://codeplex.com/entlibcontrib" target=_blank mce_href="https://codeplex.com/entlibcontrib">entlibcontrib</A>:</P>
<P>The direct link is here:</P>
<P><A title=https://www.codeplex.com/entlibcontrib/SourceControl/DownloadSourceCode.aspx?changeSetId=18160 href="https://www.codeplex.com/entlibcontrib/SourceControl/DownloadSourceCode.aspx?changeSetId=18160" mce_href="https://www.codeplex.com/entlibcontrib/SourceControl/DownloadSourceCode.aspx?changeSetId=18160">https://www.codeplex.com/entlibcontrib/SourceControl/DownloadSourceCode.aspx?changeSetId=18160</A> (Note that this is not a stable release)</P>
<P>If you are too <STRIKE>lazy</STRIKE> busy to download, open VS and compile you can download here the msi. </P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/53/89/69/StrongNamingGuidancePackageSetup.msi" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-08-53-89-69/StrongNamingGuidancePackageSetup.msi">StrongNamingGuidancePackageSetup.msi</a></p>]]></content:encoded>
    </item>
    <item>
      <title>First impressions of Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/davidhernandez/first-impressions-of-visual-studio-2008</link>
      <pubDate>Tue, 18 Dec 2007 17:54:00 GMT</pubDate>
      <dc:creator><![CDATA[David Hernández Díez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davidhernandez/2007/12/18/first-impressions-of-visual-studio-2008/</guid>
      <description><![CDATA[Now that there is a new release of Visual Studio I wanted to take a closer look at it to see which...]]></description>
      <content:encoded><![CDATA[<P>Now that there is a new release of Visual Studio I wanted to take a closer look at it to see which are the improvements and new features.</P>
<P>I really wanted to get to the new stuff about Linq and the .Net framework 3.5. But I got lost fiddling with the new UI, specially the new refactor functionality.</P>
<P>I really liked the "Organize Usings", which takes a file and removes all the unnecessary using clauses and order the rest of them. That is prety useful since&nbsp;some times you can see files that their using region is larger than the code inside, and most of them are just left overs of old code or some temporary test. It is really annoying to see so many usings since many times you end up analyzing the code or removing&nbsp;the&nbsp;using&nbsp;and compiling the project to check if it really being used. So, the fact is that you get distracted.</P>
<P>The only "but" to this utility is that it only does the job on a single file, instead of all the project or solution. So I decided to create an Ad-in so I could also test the extensibility of Visual Studio. I was really impressed that in less than two hours I had a working Add-in that removed and sorted all the using of the .cs files. You can find an attached RemoveAndSortAllusings.zip file with the code. Of course it is a really rough add-in and lots of things are missing, like using a custom Icon, or dealing with files in source control, but at least is a start.</P><!-- code formatted by https://manoli.net/csharpformat/ --><PRE class=csharpcode><SPAN class=kwrd>using</SPAN> System;
<SPAN class=kwrd>using</SPAN> Extensibility;
<SPAN class=kwrd>using</SPAN> EnvDTE;
<SPAN class=kwrd>using</SPAN> EnvDTE80;
<SPAN class=kwrd>using</SPAN> Microsoft.VisualStudio.CommandBars;
<SPAN class=kwrd>using</SPAN> System.Resources;
<SPAN class=kwrd>using</SPAN> System.Reflection;
<SPAN class=kwrd>using</SPAN> System.Globalization;
<SPAN class=kwrd>using</SPAN> System.Windows.Forms;

<SPAN class=kwrd>namespace</SPAN> RemoveAndSortAllusings
{
    <SPAN class=rem>/// &lt;summary&gt;The object for implementing an Add-in.&lt;/summary&gt;</SPAN>
    <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;</SPAN>
    <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>class</SPAN> Connect : IDTExtensibility2, IDTCommandTarget
    {
        <SPAN class=rem>/// &lt;summary&gt;Implements the constructor for the Add-in object. Place your initialization code within this method.&lt;/summary&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> Connect()
        {
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='application'&gt;Root object of the host application.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='connectMode'&gt;Describes how the Add-in is being loaded.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='addInInst'&gt;Object representing this Add-in.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> OnConnection(<SPAN class=kwrd>object</SPAN> application, ext_ConnectMode connectMode, <SPAN class=kwrd>object</SPAN> addInInst, <SPAN class=kwrd>ref</SPAN> Array custom)
        {
            _applicationObject = (DTE2)application;
            _addInInstance = (AddIn)addInInst;
            <SPAN class=kwrd>if</SPAN>(connectMode == ext_ConnectMode.ext_cm_UISetup)
            {
                <SPAN class=kwrd>object</SPAN> []contextGUIDS = <SPAN class=kwrd>new</SPAN> <SPAN class=kwrd>object</SPAN>[] { };
                Commands2 commands = (Commands2)_applicationObject.Commands;
                <SPAN class=kwrd>string</SPAN> toolsMenuName;

                <SPAN class=kwrd>try</SPAN>
                {
                    <SPAN class=rem>//If you would like to move the command to a different menu, change the word "Tools" to the </SPAN>
                    <SPAN class=rem>//  English version of the menu. This code will take the culture, append on the name of the menu</SPAN>
                    <SPAN class=rem>//  then add the command to that menu. You can find a list of all the top-level menus in the file</SPAN>
                    <SPAN class=rem>//  CommandBar.resx.</SPAN>
                    <SPAN class=kwrd>string</SPAN> resourceName;
                    ResourceManager resourceManager = <SPAN class=kwrd>new</SPAN> ResourceManager(<SPAN class=str>"MyAddin2.CommandBar"</SPAN>, Assembly.GetExecutingAssembly());
                    CultureInfo cultureInfo = <SPAN class=kwrd>new</SPAN> CultureInfo(_applicationObject.LocaleID);
                    
                    <SPAN class=kwrd>if</SPAN>(cultureInfo.TwoLetterISOLanguageName == <SPAN class=str>"zh"</SPAN>)
                    {
                        System.Globalization.CultureInfo parentCultureInfo = cultureInfo.Parent;
                        resourceName = String.Concat(parentCultureInfo.Name, <SPAN class=str>"Tools"</SPAN>);
                    }
                    <SPAN class=kwrd>else</SPAN>
                    {
                        resourceName = String.Concat(cultureInfo.TwoLetterISOLanguageName, <SPAN class=str>"Tools"</SPAN>);
                    }
                    toolsMenuName = resourceManager.GetString(resourceName);
                }
                <SPAN class=kwrd>catch</SPAN>
                {
                    <SPAN class=rem>//We tried to find a localized version of the word Tools, but one was not found.</SPAN>
                    <SPAN class=rem>//  Default to the en-US word, which may work for the current culture.</SPAN>
                    toolsMenuName = <SPAN class=str>"Tools"</SPAN>;
                }

                <SPAN class=rem>//Place the command on the tools menu.</SPAN>
                <SPAN class=rem>//Find the MenuBar command bar, which is the top-level command bar holding all the main menu items:</SPAN>
                Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar = ((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.CommandBars)[<SPAN class=str>"MenuBar"</SPAN>];

                <SPAN class=rem>//Find the Tools command bar on the MenuBar command bar:</SPAN>
                CommandBarControl toolsControl = menuBarCommandBar.Controls[toolsMenuName];
                CommandBarPopup toolsPopup = (CommandBarPopup)toolsControl;

                <SPAN class=rem>//This try/catch block can be duplicated if you wish to add multiple commands to be handled by your Add-in,</SPAN>
                <SPAN class=rem>//  just make sure you also update the QueryStatus/Exec method to include the new command names.</SPAN>
                <SPAN class=kwrd>try</SPAN>
                {
                    <SPAN class=rem>//Add a command to the Commands collection:</SPAN>
                    Command command = commands.AddNamedCommand2(_addInInstance, <SPAN class=str>"RemoveAndSortAllUsings"</SPAN>, <SPAN class=str>"Remove and Sort ALL usings"</SPAN>, <SPAN class=str>"Executes the command to remove and sort all usings in cs files."</SPAN>, <SPAN class=kwrd>true</SPAN>, 213, <SPAN class=kwrd>ref</SPAN> contextGUIDS, (<SPAN class=kwrd>int</SPAN>)vsCommandStatus.vsCommandStatusSupported + (<SPAN class=kwrd>int</SPAN>)vsCommandStatus.vsCommandStatusEnabled, (<SPAN class=kwrd>int</SPAN>)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);

                    <SPAN class=rem>//Add a control for the command to the tools menu:</SPAN>
                    <SPAN class=kwrd>if</SPAN>((command != <SPAN class=kwrd>null</SPAN>) &amp;&amp; (toolsPopup != <SPAN class=kwrd>null</SPAN>))
                    {
                        command.AddControl(toolsPopup.CommandBar, 1);
                    }
                }
                <SPAN class=kwrd>catch</SPAN>(System.ArgumentException)
                {
                    <SPAN class=rem>//If we are here, then the exception is probably because a command with that name</SPAN>
                    <SPAN class=rem>//  already exists. If so there is no need to recreate the command and we can </SPAN>
                    <SPAN class=rem>//  safely ignore the exception.</SPAN>
                }
            }
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='disconnectMode'&gt;Describes how the Add-in is being unloaded.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='custom'&gt;Array of parameters that are host application specific.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> OnDisconnection(ext_DisconnectMode disconnectMode, <SPAN class=kwrd>ref</SPAN> Array custom)
        {
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection of Add-ins has changed.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='custom'&gt;Array of parameters that are host application specific.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;        </SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> OnAddInsUpdate(<SPAN class=kwrd>ref</SPAN> Array custom)
        {
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='custom'&gt;Array of parameters that are host application specific.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> OnStartupComplete(<SPAN class=kwrd>ref</SPAN> Array custom)
        {
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host application is being unloaded.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='custom'&gt;Array of parameters that are host application specific.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='IDTExtensibility2' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> OnBeginShutdown(<SPAN class=kwrd>ref</SPAN> Array custom)
        {
        }
        
        <SPAN class=rem>/// &lt;summary&gt;Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='commandName'&gt;The name of the command to determine state for.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='neededText'&gt;Text that is needed for the command.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='status'&gt;The state of the command in the user interface.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='commandText'&gt;Text requested by the neededText parameter.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='Exec' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> QueryStatus(<SPAN class=kwrd>string</SPAN> commandName, vsCommandStatusTextWanted neededText, <SPAN class=kwrd>ref</SPAN> vsCommandStatus status, <SPAN class=kwrd>ref</SPAN> <SPAN class=kwrd>object</SPAN> commandText)
        {
            <SPAN class=kwrd>if</SPAN>(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
                <SPAN class=kwrd>if</SPAN> (commandName == <SPAN class=str>"RemoveAndSortAllusings.Connect.RemoveAndSortAllUsings"</SPAN>)
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus.vsCommandStatusEnabled;
                    <SPAN class=kwrd>return</SPAN>;
                }
            }
        }

        <SPAN class=rem>/// &lt;summary&gt;Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.&lt;/summary&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='commandName'&gt;The name of the command to execute.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='executeOption'&gt;Describes how the command should be run.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='varIn'&gt;Parameters passed from the caller to the command handler.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='varOut'&gt;Parameters passed from the command handler to the caller.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;param term='handled'&gt;Informs the caller if the command was handled or not.&lt;/param&gt;</SPAN>
        <SPAN class=rem>/// &lt;seealso class='Exec' /&gt;</SPAN>
        <SPAN class=kwrd>public</SPAN> <SPAN class=kwrd>void</SPAN> Exec(<SPAN class=kwrd>string</SPAN> commandName, vsCommandExecOption executeOption, <SPAN class=kwrd>ref</SPAN> <SPAN class=kwrd>object</SPAN> varIn, <SPAN class=kwrd>ref</SPAN> <SPAN class=kwrd>object</SPAN> varOut, <SPAN class=kwrd>ref</SPAN> <SPAN class=kwrd>bool</SPAN> handled)
        {
            handled = <SPAN class=kwrd>false</SPAN>;
            <SPAN class=kwrd>if</SPAN>(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                <SPAN class=kwrd>if</SPAN> (commandName == <SPAN class=str>"RemoveAndSortAllusings.Connect.RemoveAndSortAllUsings"</SPAN>)
                {
                    handled = <SPAN class=kwrd>true</SPAN>;

                    <SPAN class=kwrd>if</SPAN> (!_applicationObject.Solution.IsOpen)
                    {
                        MessageBox.Show(<SPAN class=str>"There is no solution to eliminate usings."</SPAN>);
                    }
                    <SPAN class=kwrd>else</SPAN> 
                    {
                        <SPAN class=kwrd>foreach</SPAN> (Project p <SPAN class=kwrd>in</SPAN> _applicationObject.Solution.Projects)
                        {
                            SearchInProject(p);
                        }
                    }

                    <SPAN class=kwrd>return</SPAN>;
                }
            }
        }

        <SPAN class=kwrd>private</SPAN> <SPAN class=kwrd>void</SPAN> SearchInProject(Project project)
        {
            SearchInProjectItem(project.ProjectItems);
        }

        <SPAN class=kwrd>private</SPAN> <SPAN class=kwrd>void</SPAN> SearchInProjectItem(ProjectItems projectItems)
        {
            <SPAN class=kwrd>if</SPAN> (projectItems == <SPAN class=kwrd>null</SPAN>)
            {
                <SPAN class=kwrd>return</SPAN>;
            }


            <SPAN class=kwrd>foreach</SPAN> (ProjectItem projectItem <SPAN class=kwrd>in</SPAN> projectItems)
            {
                <SPAN class=rem>//Eliminate the unnecessary using in cs files.</SPAN>
                <SPAN class=kwrd>if</SPAN>(projectItem.Name.EndsWith(<SPAN class=str>".cs"</SPAN>))
                {
                    <SPAN class=kwrd>bool</SPAN> wasOpened = <SPAN class=kwrd>false</SPAN>;
                    <SPAN class=kwrd>if</SPAN> (projectItem.get_IsOpen(Constants.vsViewKindCode))
                    {
                        wasOpened = <SPAN class=kwrd>true</SPAN>;
                    }

                    Window w = projectItem.Open(Constants.vsViewKindCode);
                    w.Activate();
                    _applicationObject.ExecuteCommand(<SPAN class=str>"Edit.RemoveAndSort"</SPAN>, <SPAN class=str>""</SPAN>);

                    <SPAN class=kwrd>if</SPAN> (!wasOpened)
                    {
                        w.Close(vsSaveChanges.vsSaveChangesYes);
                    }
                    
                }
                
                
                <SPAN class=kwrd>if</SPAN> (projectItem.SubProject != <SPAN class=kwrd>null</SPAN>)
                {
                    SearchInProject(projectItem.SubProject);
                }
                <SPAN class=kwrd>else</SPAN>
                {
                    SearchInProjectItem(projectItem.ProjectItems);
                }
            }
        }


        <SPAN class=kwrd>private</SPAN> DTE2 _applicationObject;
        <SPAN class=kwrd>private</SPAN> AddIn _addInInstance;
    }
}</PRE>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/06/80/03/08/RemoveAndSortAllusings.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-06-80-03-08/RemoveAndSortAllusings.zip">RemoveAndSortAllusings.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>