<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>John W Powell : Visual Studio</title><link>http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx</link><description>Tags: Visual Studio</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Subscribe to SharePoint Web Parts using Internet Explorer 8 Web Slices</title><link>http://blogs.msdn.com/johnwpowell/archive/2009/02/01/subscribe-to-sharepoint-web-parts-using-internet-explorer-8-web-slices.aspx</link><pubDate>Mon, 02 Feb 2009 00:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9388724</guid><dc:creator>johnwpowell</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/9388724.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=9388724</wfw:commentRss><description>&lt;P&gt;One of the new features of Internet Explorer 8 is &lt;EM&gt;Web Slices.&amp;nbsp; &lt;/EM&gt;This feature enables you to subscribe to a &lt;EM&gt;section&lt;/EM&gt; of a web page and notifies you when the content changes.&amp;nbsp; By design, SharePoint Web Parts are a natural fit for this feature, and in this article I’ll show you how to build a Web Part that does just that.&amp;nbsp; I’ll also show you how easy it is to develop a web part using the CTP release of Visual Studio 2008 Extensions for Windows SharePoint Services (VSSWse) 1.3.&lt;/P&gt;
&lt;H3&gt;About Web Slices&lt;/H3&gt;
&lt;P&gt;Web Slices enable you to have a very narrow control over the content you subscribe to.&amp;nbsp; When you browse a page that has Web Slice sections, they “light up” when you hover over them:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb.png" width=344 height=68 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In addition, the new Web Slice icon on the toolbar lights up, and the menu is populated with all the slices on the page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_4.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_1.png" width=198 height=59 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_1.png"&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When you subscribe to a slice, the web page section is added to the toolbar and is periodically refreshed.&amp;nbsp; The refresh interval is completely customizable and can also be refreshed manually:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_6.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_6.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_2.png" width=426 height=297 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Defining a Web Slice Section&lt;/H3&gt;
&lt;P&gt;Web Slices are defined with HTML tags that have certain CSS classes.&amp;nbsp; You can read the &lt;A href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx"&gt;full specification&lt;/A&gt;, but here’s all you need to know to build your first Web Slice:&lt;/P&gt;
&lt;P&gt;To define a Web Slice section, use the &lt;EM&gt;hslice&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;div class="hslice" id="1"&amp;gt;…&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To define the slice title, use the &lt;EM&gt;entry-title&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;p class="entry-title"&amp;gt;Game System - $66.00&amp;lt;/p&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To define the slice content, use the &lt;EM&gt;entry-content&lt;/EM&gt; class name:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;div class="entry-content"&amp;gt;This auction closes in 4 hours.&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The end result looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;&amp;lt;div class="hslice" id="1"&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p class="entry-title"&amp;gt;Game System - $66.00&amp;lt;/p&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="entry-content"&amp;gt;This auction closes in 4 hours.&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;/div&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;H3&gt;Build a SharePoint Web Part&lt;/H3&gt;
&lt;P&gt;For this example, I’m using VSSWSE 1.3 which you can read about &lt;A href="http://blogs.msdn.com/sharepoint/archive/2009/01/12/announcing-community-technology-preview-of-visual-studio-2008-extensions-for-sharepoint-v1-3.aspx" target=_blank mce_href="http://blogs.msdn.com/sharepoint/archive/2009/01/12/announcing-community-technology-preview-of-visual-studio-2008-extensions-for-sharepoint-v1-3.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; I would recommend it not only because it’s easy to use, but also because it is sure to become the de-facto standard.&amp;nbsp; To get started, create a new Web Part project:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_8.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_8.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_3.png" width=616 height=442 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_3.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Choose if you want to deploy to the GAC or bin directory.&amp;nbsp; We’ll use GAC for this example:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_10.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_4.png" width=362 height=215 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A solution is created with a default web part named WebPart1.&amp;nbsp; Rather than renaming it, delete the WebPart1 folder and add a new Web Part to the project with a more descriptive name:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_12.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_12.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_5.png" width=616 height=373 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next, configure the url of your SharePoint site you want to use to test the Web Part.&amp;nbsp; On the Debug settings, set the start url:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_20.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_20.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_9.png" width=615 height=113 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In the Web Part, override the CreateChildControls method:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_16.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_16.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_7.png" width=616 height=363 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_7.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code generates the needed HTML and is pretty self-explanatory.&amp;nbsp; I chose to hide the Web Slice entry-title as it would be redundant beneath the Web Part title.&amp;nbsp; To test the code, right-click the solution or project and select Deploy.&amp;nbsp; This will package the Web Part as a feature and deploy and activate it on the site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_22.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_22.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_10.png" width=392 height=169 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_10.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, add the Web Part to a page in the site and test it.&lt;/P&gt;
&lt;H3&gt;How I Wished It Worked&lt;/H3&gt;
&lt;P&gt;Web Slices are powerful, but I don’t really want to develop a bunch of new Web Parts to use that feature.&amp;nbsp; I wish every Web Part were capable of wrapping its content in a Web Slice div tag.&amp;nbsp; I’m sure there is a way to inject this functionality (and there might even be a supported method), but I wish it were built in to the Web Part framework.&amp;nbsp; Every Web Part could then have a Web Slice category with relevant settings:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_18.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_18.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_8.png" width=237 height=219 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/cb2a34ee5175_A8A8/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Wouldn’t that be powerful?&lt;/P&gt;
&lt;H3&gt;Summary&lt;/H3&gt;
&lt;P&gt;In this article, I demonstrated how to build a Web Part that users can subscribe to using Web Slices.&amp;nbsp; I also showed you how easy it is to build a Web Part using the CTP release of Visual Studio 2008 Extensions for Windows SharePoint Services version 1.3.&amp;nbsp; Happy slicing!&lt;/P&gt;
&lt;H3&gt;References and Additional Reading&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/download-ie.aspx" target=_blank&gt;Internet Explorer 8 Download&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc196992(VS.85).aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc196992(VS.85).aspx"&gt;Subscribing to Content with Web Slices&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc304073%28VS.85%29.aspx"&gt;Web Slice Format Specification&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=4A7F2178-DB7E-4325-98B5-15FA725708E2&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=4A7F2178-DB7E-4325-98B5-15FA725708E2&amp;amp;displaylang=en"&gt;Web Slice Icon and Guidelines&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/beta/videos.aspx?vindex=3" target=_blank mce_href="http://www.microsoft.com/windows/internet-explorer/beta/videos.aspx?vindex=3"&gt;Internet Explorer 8 Videos : Web Slices&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9388724" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WSS/default.aspx">WSS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/WSS3/default.aspx">WSS3</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Windows+SharePoint+Services/default.aspx">Windows SharePoint Services</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Language Changes to Chinese While Writing Code in Visual Studio 2008</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/05/09/language-changes-to-chinese-while-writing-code-in-visual-studio-2008.aspx</link><pubDate>Fri, 09 May 2008 02:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8475627</guid><dc:creator>johnwpowell</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8475627.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8475627</wfw:commentRss><description>&lt;P&gt;I recently experienced what could be misinterpreted as a bug in Visual Studio 2008.&amp;nbsp; While feverishly typing code, the language "randomly" changed to Chinese.&amp;nbsp; Here's what it looked like: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/Chinese_2.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/Chinese_2.png"&gt;&lt;IMG height=131 alt=Chinese src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/Chinese_thumb.png" width=532 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/Chinese_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Of course it's not a a bug--it's a feature!&amp;nbsp; Left ALT + SHIFT is the Windows shortcut for changing the input language, and since I use ALT and SHIFT so frequently in Visual Studio, I occasionally hit the keys at the same time!&lt;/P&gt;
&lt;P mce_keep="true"&gt;You can easily see which language you are in by looking at the language bar:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/japanese_2.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/japanese_2.png"&gt;&lt;IMG height=57 alt=japanese src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/japanese_thumb.png" width=296 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/japanese_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;You can change or disable the keystrokes by right-clicking on the language bar and selecting &lt;EM&gt;Settings:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/LanguageSettings_2.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/LanguageSettings_2.png"&gt;&lt;IMG height=493 alt=LanguageSettings src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/LanguageSettings_thumb.png" width=418 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/LanguageSettings_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Then select &lt;EM&gt;Between input languages&lt;/EM&gt; and click &lt;EM&gt;Change Key Sequence:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/ChangeKeySequence_2.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/ChangeKeySequence_2.png"&gt;&lt;IMG height=205 alt=ChangeKeySequence src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/ChangeKeySequence_thumb.png" width=425 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/LanguageChangestoChineseWhileWritingCode_11584/ChangeKeySequence_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If you have fat finger issues like me, you probably want to select &lt;EM&gt;Not Assigned.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;So next time you find something that seems like a bug, remember, it just might be a feature!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;References&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/bb545461.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/bb545461.aspx"&gt;Windows Keyboard Shortcuts&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8475627" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Input+Language/default.aspx">Input Language</category></item><item><title>Team Explorer Window Won't Open Or Is Blank</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/05/05/team-explorer-window-won-t-open-or-is-blank.aspx</link><pubDate>Mon, 05 May 2008 22:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8461175</guid><dc:creator>johnwpowell</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8461175.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8461175</wfw:commentRss><description>&lt;P&gt;If recently worked with several&amp;nbsp;developers that were unable to open the&amp;nbsp;Team Explorer 2008 window (or if they did open it, the window was blank).&amp;nbsp; They had pre-release versions of Visual Studio 2008 installed and despite following the &lt;A class="" href="https://www.microsoft.com/express/support/uninstall/default.aspx" target=_blank mce_href="https://www.microsoft.com/express/support/uninstall/default.aspx"&gt;instructions on uninstalling previous versions&lt;/A&gt;, were unsucessful.&amp;nbsp; Having found the fix for this issue, I thought I'd share it in case anyone else encounters it.&lt;/P&gt;
&lt;P&gt;Open a Visual Studio 2008 command prompt and run the following command:&lt;/P&gt;
&lt;P&gt;devenv /setup&lt;/P&gt;
&lt;P&gt;It will take awhile for this command to complete, but afterwards, the issue should be resolved.&amp;nbsp; &lt;A class="" href="http://msdn.microsoft.com/en-us/library/ex6a2fad(vs.80).aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/ex6a2fad(vs.80).aspx"&gt;Here is documentation&lt;/A&gt; on the /setup switch if you would like to know more about it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8461175" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/TFS/default.aspx">TFS</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Team+Explorer/default.aspx">Team Explorer</category></item><item><title>10 Tips to Boost Your Productivity with C# and Visual Studio 2008</title><link>http://blogs.msdn.com/johnwpowell/archive/2008/03/23/10-tips-to-boost-your-productivity-with-c-and-visual-studio-2008.aspx</link><pubDate>Sun, 23 Mar 2008 14:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8332207</guid><dc:creator>johnwpowell</dc:creator><slash:comments>26</slash:comments><comments>http://blogs.msdn.com/johnwpowell/comments/8332207.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnwpowell/commentrss.aspx?PostID=8332207</wfw:commentRss><description>&lt;H3&gt;Learn Key Bindings&lt;/H3&gt;
&lt;P&gt;It's an obvious and trivial thing, but the timesaving will add up, especially for those actions you perform tens or hundreds of times a day such as building and debugging.&amp;nbsp; Here are some basic bindings every Visual Studio developer should know: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Build: &lt;STRONG&gt;CTRL&lt;/STRONG&gt; + &lt;STRONG&gt;SHIFT&lt;/STRONG&gt; + &lt;STRONG&gt;B&lt;/STRONG&gt; 
&lt;LI&gt;Word completion: &lt;STRONG&gt;CTRL&lt;/STRONG&gt; + &lt;STRONG&gt;SPACE&lt;/STRONG&gt; 
&lt;LI&gt;Start with debugging: &lt;STRONG&gt;F5&lt;/STRONG&gt; 
&lt;LI&gt;Start without debugging: &lt;STRONG&gt;CTRL&lt;/STRONG&gt; + &lt;STRONG&gt;F5&lt;/STRONG&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Even expert Visual Studio developers can benefit by learning new bindings&lt;/EM&gt;. Download the &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&amp;amp;displaylang=en"&gt;Visual C# 2008 Keybinding Reference Poster&lt;/A&gt; and hang it in your work area. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Generate XML Comments with GhostDoc&lt;/H3&gt;
&lt;P&gt;Instead of typing XML comments by hand, let a tool do the work for you. Although macros and snippets are reasonably effective for this, I would recommend &lt;A href="http://www.roland-weigelt.de/ghostdoc/" target=_blank mce_href="http://www.roland-weigelt.de/ghostdoc/"&gt;Ghost Doc&lt;/A&gt; over any other solution. This &lt;EM&gt;free&lt;/EM&gt; add-in uses customizable templates to generate consistent, English-readable documentation based on the current context.&amp;nbsp; To use it, right-click (or use CTRL + SHIFT + D) to document the current element.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=90 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb.png" width=327 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This generates the following documentation (note GhostDoc split the property name into words and created a sentence from it): &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=102 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_1.png" width=669 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Auto-Implement Properties &lt;/H3&gt;
&lt;P&gt;Take advantage of a new feature of C#: &lt;A href="http://msdn2.microsoft.com/en-us/library/bb384054.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/bb384054.aspx"&gt;auto-implemented properties&lt;/A&gt;. Rather than creating a private backing field for your properties, let the compiler do it for you. The following demonstrates the syntax: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_6.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=100 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_2.png" width=322 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Use the code snippet to make this even faster.&amp;nbsp; Type &lt;STRONG&gt;prop&lt;/STRONG&gt; (the shortcut for an auto-implemented property) followed by &lt;STRONG&gt;TAB&lt;/STRONG&gt; &lt;STRONG&gt;TAB&lt;/STRONG&gt;.&amp;nbsp; Then fill in the data type and property name:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_30.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_30.png"&gt;&lt;IMG height=47 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_14.png" width=302 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_14.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Refactor&lt;/H3&gt;
&lt;P&gt;The refactor feature in Visual Studio is indispensable for many tasks, especially renaming, but one productivity feature I particularly like is &lt;EM&gt;Encapsulate Field&lt;/EM&gt;. If you are unable to use an auto-implemented property, declare a private field and let Visual Studio generate the Property for you.&amp;nbsp; To use this feature, right-click on the field and select &lt;EM&gt;Refactor&lt;/EM&gt; &amp;gt; &lt;EM&gt;Encapsulate Field...&lt;/EM&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_8.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=144 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_3.png" width=592 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The property is created for you: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_10.png"&gt;&lt;IMG height=128 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_4.png" width=274 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_4.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Add Commands to Visual Studio 2008 &lt;/H3&gt;
&lt;P&gt;Install the &lt;A href="http://code.msdn.microsoft.com/PowerCommands" target=_blank mce_href="http://code.msdn.microsoft.com/PowerCommands"&gt;PowerCommands for Visual Studio 2008&lt;/A&gt; to add several productivity commands such as: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Close all documents 
&lt;LI&gt;Copy and paste a class (automatically renames) 
&lt;LI&gt;Remove and sort using statements project-wide 
&lt;LI&gt;Copy and paste references (including a project reference) &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Install the &lt;A href="http://msdn2.microsoft.com/en-us/tfs2008/bb980963.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/tfs2008/bb980963.aspx"&gt;Team Foundation Server Power Tools&lt;/A&gt; to add several TFS productivity commands such as:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Find in source control&lt;/LI&gt;
&lt;LI&gt;Open source folder in Windows Explorer&lt;/LI&gt;
&lt;LI&gt;Work item templates (can be used to set values on multiple work items at once)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Add your own productivity commands.&amp;nbsp; For example, to add &lt;A href="http://www.aisto.com/roeder/dotnet/" target=_blank mce_href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector&lt;/A&gt; so it automatically opens on the current project.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Select Tools &amp;gt; External Tools&lt;/LI&gt;
&lt;LI&gt;Click Add&lt;/LI&gt;
&lt;LI&gt;Name it Reflector and browse to the executable&lt;/LI&gt;
&lt;LI&gt;Enter $(TargetPath) for the Arguments&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;
&lt;H3&gt;Speed up Compilation with Project Configuration&lt;/H3&gt;
&lt;P&gt;You may build tens of times during a programming session, so don't enable anything that isn't absolute necessary such as code analysis and XML documentation.&amp;nbsp; Develop in Debug configuration, and switch to Release configuration just before check-in to run code analysis and generate XML documentation. In a large solution I recently worked on, this shaved a minute off compilation time.&lt;/P&gt;
&lt;P&gt;The following shows code analysis &lt;EM&gt;disabled&lt;/EM&gt; in Debug configuration: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_12.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=79 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_5.png" width=508 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The following shows code analysis &lt;EM&gt;enabled&lt;/EM&gt; in Release configuration:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_14.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_14.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=72 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_6.png" width=513 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_6.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Let Visual Studio Generate Unit Test Code&lt;/H3&gt;
&lt;P&gt;Although it can't fully automate unit testing yet (check out &lt;A href="http://research.microsoft.com/projects/Pex/" target=_blank mce_href="http://research.microsoft.com/projects/Pex/"&gt;Pex&lt;/A&gt;), Visual Studio does a good job of generating &lt;A href="http://en.wikipedia.org/wiki/Test-driven_development" target=_blank mce_href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;positive unit test&lt;/A&gt; code to give you a jump start.&amp;nbsp; To use this feature, right-click on an element you would like to test and select &lt;EM&gt;Create Unit Tests...&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_16.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_16.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=186 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_7.png" width=312 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Visual Studio generates the following test method:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_18.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_18.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=244 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_8.png" width=683 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_8.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Use Interface-Driven-Design&lt;/H3&gt;
&lt;P&gt;You probably never thought of an interface as a productivity feature, but it can be if your development process is driven by contracts instead of implementation.&amp;nbsp; Let me illustrate with a simplified example.&amp;nbsp; One developer owns the business layer and another developer owns the data access layer, and they need to agree on how to communicate to implement a new feature.&amp;nbsp; In some business object designs, business components will instantiate data components (or call a static method).&amp;nbsp; This is a problem from a design standpoint because the two become tightly coupled.&amp;nbsp; It is also a problem from the productivity standpoint because the business layer developer becomes dependent on the data access layer developer's implementation.&amp;nbsp; &lt;EM&gt;Interface-driven design (IDD) solves this issue&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;Rather than the business component developer waiting on the data component developer, they meet to design and implement the interface.&amp;nbsp; Both developers are then free to go their separate ways and implement the components in parallel.&amp;nbsp; IDD also enables the business developer to mock the data access component, thereby removing any scheduling dependencies.&amp;nbsp; The following illustrates the design:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_24.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_24.png"&gt;&lt;IMG height=451 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_11.png" width=368 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_11.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Make a Mockery of Dependencies&lt;/H3&gt;
&lt;P&gt;Different developers may own layers or features that your component is dependent on, but don't let that slow you down.&amp;nbsp; Suppose you are responsible for the business layer which depends on the data access layer which in turn depends on database tables and stored procedures. Rather than waiting for dependent layers to be completed, mock the data access layer so you can implement and unit test the business layer. By the way, you should be using mocks anyway; otherwise your unit tests are more than likely integration tests.&amp;nbsp; I recommend &lt;A href="http://ayende.com/projects/rhino-mocks.aspx" target=_blank mce_href="http://ayende.com/projects/rhino-mocks.aspx"&gt;Rhino Mocks&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here is a sample unit test with mocks:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_22.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_22.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=578 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_10.png" width=648 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_10.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Data Drive Unit Tests&lt;/H3&gt;
&lt;P&gt;If you have a unit test that multiple inputs to fully test, you &lt;EM&gt;could&lt;/EM&gt; write a test method for every possible combination, but data-driven unit tests are more efficient.&amp;nbsp; When the unit test is run, it loads data from a table and calls the unit test for each row.&amp;nbsp; You can access the data in the current row using the TestContext.DataRow property. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_26.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_26.png"&gt;&lt;IMG height=246 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_12.png" width=1008 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Once the test completes, you can view the results:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_28.png" mce_href="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_28.png"&gt;&lt;IMG height=142 alt=image src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_13.png" width=353 border=0 mce_src="http://blogs.msdn.com/blogfiles/johnwpowell/WindowsLiveWriter/10TipstoBoostYourProductivitywithCandVis_753E/image_thumb_13.png"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8332207" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Unit+Test/default.aspx">Unit Test</category><category domain="http://blogs.msdn.com/johnwpowell/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item></channel></rss>